Win or lose, "the goal is always to collect as much data as possible," to learn what works and what doesn't, to test for weaknesses. Test flights take place so SpaceX can intentionally stress Starship.
If you want to fly to Mars, you have to get out of the office and up into real space so you can learn what you don't know: like how to build the world's first "reusable orbital heat shield." It's never been done. But it will be.
After two scrubbed launch windows, Starship test flight #10 got off the ground Tuesday evening. SpaceX posted a two-hour live video full of information about work they did after the last flight and what they hope for in this flight. Actual launch starts at 46:45.