It wasn't actually a failure. It's the first time they stacked Starship on top of a booster, and tried to launch it.
They considered it lifting off the pad in an actual launch a success. And they fully expected something to happen - Elon Musk promised it would be "exciting."
Every time they launch, they get data, and that helps them fix any problems found, and move on to the next launch. It would have been phenominal for it to have separated, but certainly not a failure today.
Not to mention... this was Starship 24 and booster 7. That shows you how many prototypes they've gone through (with a few having a some spectacular RUDs and hard landings of their own!).