Sure, between the bigger cities, the train is amazing. I did Valencia to Madrid by high speed rail in 2022 for example. Works great. The average speed is close to the maximum speed of the train; it only slows down to stop.
But for the more rural regions and smaller cities, you pretty much need a car.
+1. But the train, specially being in Madrid, is a very good alternative to the car to travel around Spain.