Usually most countries are smart enough not to damage themselves economically by preventing their companies from selling to a large, reasonably rich union.
They could also just not follow the law
The US government will not back up from their policy and so we do neither but since we otherwise enjoy a great partnership and alliance, we take this issue pretty "dry and emotionless", trust me, there are no hard feelings or ill intentions.
I never understood American magical thinking that blames Europe for US military spending. In the end, if you want to cut military spending, you can.
Regardless, you're the hegemon. I don't accept that you don't benefit from that position.
EDIT: It's like saying "This thing you're giving me that allows my whole economy to function, I don't like the consequences of how you're doing it."
Of course that means the US will no longer be a global superpower, but the US can freely choose that.
I could imagine a US based law that banned the sale of any durable goods produced by a company headquartered in a country that still got more than 5% of its power from lignite coal due to a strong climate commitment. That's tailored basically only to impact Germany. Is that fair?