The money is there, it is being put into the wrong hands and into silly bureaucracy (for example by having to put out construction projects on the EU market, while local businesses collapse, ruining Germany's own economy).
The market does not regulate that, and everyone who takes a look can see that, no matter how often some FDP or CDU wacko will claim otherwise. That is the point I am making. The market is very short sighted, oriented towards short term gain, at the cost of the general public. The general public needs to deal with the fallout of it all. Terrible train service, bad infrastructure, expensive public transport, too many cars, bad air quality, bad health, lacking education, the list goes on. All those matters are matters, where spending does not directly benefit some already wealthy group of people.
It goes even further: The "market", consists also of lobbyists, who do everything they can to influence politicians and get policies implemented, that make people buy cars, even at the cost of worsening public infrastructure. They have delayed developing electric cars and are now clinging to the German market. They do not care about normal people having to get to work via public transport. Buy a frickin' car! Is their response. Instead of improving public transport, it gets noticeably worse every year. So the free market is not only responsible for not doing good things, it is also responsible for actively harming the population.
Now it may be, that the free market also has its upsides. But the view that it will solve all the problems if we only let it is very naive and proven wrong again and again.