Well - that is a bit one-sided now, Mottenhausen. It is definitely in the interest of the communities to "retain" such citizens who have already actively participated in community life. As far as I know, this also always gives extra points when awarding [something], if you are in various clubs, with the fire department, the local water rescue service, the music band, etc. Clearly, they want to keep such citizens - and prefer them during the allocation. I can certainly understand that.
On the other hand, I definitely know communities (yes, even here in Bavaria!!!) that actively involve their new citizens. As an example, I would like to mention Irsingen from the municipality of Türkheim in Unterallgäu, which invites all new citizens who have moved in during the past two years to a new citizens' meeting every two years, where all clubs introduce themselves and all village internal activities are presented to the "newcomers."
We have friends who moved there, both not Bavarians, who immediately had connections, are now involved in the fire department, stock shooting club, and after one year practically know the whole village and feel very comfortable and accepted - so that exists as well.
So I wouldn't say "exclude outsiders" - locals are preferred. But for example, anyone who buys an existing property is not affected by that.