Siemens is not Germany. Seimens and the other companies trading globally determined it was best to comply with the American sanction.
The companies are not the government
This Siemens....
https://seekingalpha.com/news/3277075-reuters-siemens-turbines-delivered-crimea-despite-sanctions
And this Siemens...
And last but not least, thus Siemens...
http://www.washingtoninstitute.org/policy-analysis/view/iran-sanctions-the-german-control-problem