Reinheitsgebot
Hops were added as a method of preservation (to stop the beer going bad quickly).   Hops were allowed to stop other things (like adding certain mushrooms to the beer, which was done in the Middle Ages) being done to preserve beer. Other herbs, like stinging nettles had been used. The stinging nettle is part of the same plant family as hops.