No experience with the building codes in Berlin, but a least the N story limit makes sense to me. It would totally destroy the look and feel of many parts of the city of this wasn’t in place.
What I think is a bigger problem is the countless vacant lots all over the city. Even centrally there are tons of them, e.g. with only a one story supermarket or parking lots (as mentioned above) or sometimes it’s just overgrown. I wonder what the deal are with those. My guess is that the city already sold them in more dire times and now owners just sit on them until the real estate prices makes the time ripe to build something there. Can’t find another explanation for it.