It's not as clear cut as you say. The German constitutional court has not given its last word on the topic, even though they said in a preliminary decision that sufficient protection against Measles outweighs the right of unvaccinated children to go to school.
Nobody's actually forcing one to get vaccinated against measles in Germany. It's only mandatory for kids which go to daycare, kindergarten or school and their caregivers and teachers. OTOH, going to school is mandatory, so for kids it is pretty much mandatory by extension.