The solution, IMHO, building more, could be theoretically be championed by the State, but with ever-increasing construction costs, regulation, taxes on everything, scarcity of land in big cities, and pensions entitlements, where will the money come from? It's not cheap to build with the quality standards that we all desire everyone to have.
Building co-ops like those that exist in Vienna do exist in Spain, but they are not a panacea, the same problems that a State-run initiative has will apply.