Basically Spain is still playing that famous tiki-taka style where they just pass, and we all know that it worked amazingly for a while but the reality is that teams figured that out with deep defence already, if you can't pass through passes to make sure people can score, that's not going to work and you do not have a Messi to help you out there.
Tiki-taka of Spain is outdated and they need an upgrade version of it like what Manchester City and Pep Guardiola are using in their club. Unfortunately, Manchester City have better players than Spain have. City have better midfielders, better tactic and a top-notch striker Erling Haaland. It's important for Spain to have a top-notch striker who can create pressure on opponent's defenders like Haaland. Many years since retirement of David Villa and Fernando Torres, Spain have yet found a good striker to replace them.
Manchester City versions with and without Haaland are very different and a version with Haaland brings lot of fear to their opponents.
Spain needs to figure out it is not working anymore, even Pep is having hard time with a billion dollar team, got Haaland to make sure it would work.
They need to upgrade their tactics first and next, must have some necessary players for it. They need both to succeed in next big tournaments.
All in all, I feel like it is the tactic that caused them to lose, Morocco played a much
Spain lost against Italy in Euro 2020 and Morocco in World Cup 2022 in a same way. They dominated these matches but failed to win within 120 minutes. At penalty spots, they failed to both opponents. Spain is like England with very bad records on penalty spots.