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.
The laws don't work like that, otherwise we arguably would not have any parties left.
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.