That's simply false. You can cancel a lease with a renter because of "Eigenbedarf" (personal need) if you want to move into your own property. There's some limitations around it when you buy a property with a renter in it but in general that's how it works.
In Germany, the "basic law" (rougly: constitution) says:
> (2) Property entails obligations. Its use shall also serve the public good.
The state protects your property but this obliges you to also use it for the public good. It's not an absolute right.