Because Germany has laws specifically to ban parties that are shown to undermine democratic order, specifically to stop another situation where they gain a majority vote.
> Because Germany has laws specifically to ban parties that are shown not to be working in the best interest of the people
The laws don't work like that, otherwise we arguably would not have any parties left.
That is not the criteria of banning a party. There is the Verfassung or constitution. If you work towards the abolition of the constitution, then you will get punished.
And that AfD is against the best interest of the people, i guess, you can not be serious. It is a populist party that picks up all the things that people are not happy about and are popular, but ignored. It is actually in the very interest of the people who vote for them. But of course scary for the people, who get voted out. Majority wins.