Which they want to have out of their self interest and not because they are forced too. And no, they are not occupied by any definition. Ukraine is an example of a country which is partially occupied by a foreign force.
There is something like 40 thousand American soldiers in Germany. Way, way too little to influence actual policy of a rich country with > 80 million people.
I speak German and I can guarantee you that American military presence has approximately zero influence on German politics.
This is not how an "occupied" country works. You know how an occupied country looks like? Like Czechoslovakia after 1968. The Soviet troops were permanently stationed there to cow our own Communists into submission to the Moscow line. Once it became clear that Gorbachev was no longer willing to actually use them for this purpose, the regime disintegrated within a few years.
"I speak German and I can guarantee you that American military presence has approximately zero influence on German politics."
Then why the fuck did they put sanctions on Russia? Why the fuck did they agree to buy a much more expensive liquid gas from the US when they had a cheaper alternative that allowed them to have such a great economy? And why did they not react when Nord Stream pipelines, the source of that cheap gas, got blown up?
What, they just sucked it up and said "hell, it's worth it, at least Russia is bad!"?
They tanked their own economy because Uncle Sam told them to do so, and not a single rational decision has ever been made by the German government since February 2022.
Spoiler alert: not everyone elevates money and economy über alles. What you call "rational" I would call "endlessly cynical".
Russian invasion of Ukraine destabilized security relationships in half of Europe and quite a lot of Germans are sensitive about it. Your view that German economy matters the most and the Russian imperial project is morally irrelevant is mostly carried by AfD, which attracts about a quarter of the total vote. I would say that another quarter of the German population genuinely doesn't care that way or the other, but that still leaves about a half which considers Putin an evil guy and does not want to maintain tight contact with him, much like you don't just invite gangsters into your business for some money.
Granted, the balance of views in Germany is nowhere near as one-sided as in Poland where 90 per cent of people hate and loathe and fear Putin as a mortal enemy, but still. German nation as a whole isn't in mood to make happy deals with Putin and the actions of the politicians reflect that mood.
Both states harbor huge US military bases. Bases that were established after literal military occupation and not by choice.
It's safe to say that they can't truly be free and choose their own policies. By definition, they are both occupied states.