You need to buy tickets in advance for La Sagrada Familia, Parc Guell, Casa Batllo (in general; I don't know about the "rooftop show"), Casa Mila/La Pedrera, Picasso Museum and Palau de la Musica Catalana (because the English-language tours sometimes sell out, and they don't run constantly).
I'm with you on hating to pin down my sightseeing ahead of time, but if you do not buy tickets for those places in Barcelona (with the possible exception of Palau de la Musica Catalana), you will be standing in a long ticket line (quite likely over an hour). When you at long last get up to the ticket counter, you may be told all the day's tickets have been sold or that you need to come back in 3 hours--which really messes up a tourist's day. It is unfortunate, but it's just the way it is.
If you can bear to do it, slot one of those problematic sites first thing each morning so you don't have to worry about being on time for them.
As far as I know you don't need to book the Montserrat trip ahead of time. You just go to the train station beneath Placa de Espanya and buy a package ticket there.
For Madrid I wouldn't expect issues at Temple de Debod.
I know nothing about the flamenco show.
I think you can save a bit of money by buying the Segovia train tickets early. Compare today's/tomorrow's fare on renfe.com to what you see for the first week of June. The difference is your approximate potential savings. I have not heard that those ticket sell out. (I know the trains to and from Toledo do sell out.)
You might be OK to wait for the Prado ticket, but I cannot guarantee that. I'm not sure it's possible for the museum to sell out--does it even sell timed tickets? But you could conceivably be in a line that would take some time to clear.
The Palacio Real may be somewhat riskier than the Prado. It seemed more popular when I was in Madrid in 2016. A ticket line wouldn't be surprising. My bet is that weekends and holidays are riskier than weekdays if you want to roll the dice.
Although it doesn't require pre-booking as far as I know, one of our other posters has warned that you won't get into the Naval Museum in Madrid without your passport.