For 500 years, Bavaria's beer purity law, known as the Reinheitsgebot, has restricted beer recipes to only the essential ingredients: barley, hops and water.

Some drinkers might choose their beer on the fruity flavour or the promise of a hint of spice. But while including pumpkin in the kettle or adding ginger to a recipe is fine by most brewers, in Bavaria it’s not. For 500 years, Bavaria's beer purity law, known as the Reinheitsgebot, has restricted beer recipes to only the essential ingredients: barley, hops and water.

Bavaria is proud of their purity law. Established in 1516, and gradually spreading across the whole of Germany, the Reinheitsgebot was originally implemented to regulate prices, avoid price competition with bakers over wheat and rye and prevent brewers from adding impurities into their recipes. As refrigeration and canning were not available in the Middle Ages, beer would often spoil, and less ethical brewers would mask the taste to extend the shelf life.

While technologies have improved and there have been some amendments to the law – yeast and wheat, for instance, were permitted into the recipe at later dates – the country is not likely to remove this cultural cornerstone anytime soon.

For years, Germans have debated the Reinheitsgebot. Many proudly view it as a part of the country’s cultural identity, with up to 85% of the population supporting the law, according to a recent survey by the Forsa Institute – and that includes the influential German Brewers' Association, which represents the nation's main breweries. However, others are watching the experimental craft beer market take off elsewhere and feel that German beer is falling behind the times.

But despite the law – or because of it – German beer is renowned as being some of the best in the world, regularly sweeping up awards at beer shows. On a recent trip to Bavaria, I visited some of the region’s most historical breweries and others that are defying tradition to learn how the law is shaping beer today.

Along the Danube River, outside of the quiet city of Kelheim in the middle of Bavaria, sits the peaceful Weltenburg Monastary. While people of faith might head to the church, most visitors seemed to be zealously drawn to the bocks and dunkels served in the courtyard beer garden. This is one of the oldest monastery breweries in the world, where monks have produced beer since 1050.

Head brewer Ludwig Mederer has been brewing Weltenburg's dark beers for the past six years. While never a holy man, he still brews in the tradition of the monks and follows the sacred laws of the Reinheitsgebot, honouring the history and tradition passed on to him.

“We're very proud of [the purity laws],” Mederer said, explaining that nothing about the law or tradition limit his creativity, as the variety of ingredients, temperatures and time limits still allow for millions of possible outcomes.

Fortunately for Mederer, the monastery is blessed with location, sitting atop a quality hard water source that is perfect for dark beer. It is also proximate to expansive barley fields and Hopfenland, the region that grows some of the finest hops in the world. According to Mederer, “the most important thing is how to put those ingredients together.”

His amalgams produce incredible dark beers, from the rich double bock that leaves drinkers with a chocolate finish to malty beers brewed especially for Oktoberfest.

Mederer has no interest in straying from the purity laws. He has never been inclined to lace his beer with coffee beans or chocolate. However, he learned his craft at Schneider Weisse, a brewery just down the Danube whose wheat beers would have been banned by the Reinheitsgebot of 1516 ­– though they’re considered kosher under the amended law today.

After the Reinheitsgebot was altered to permit wheat in the mid-1500s, Bavaria’s first wheat beer brewery opened in Kelheim in 1607. Over the years, the brewery changed hands a half dozen times and was finally purchased in 1928 by the Schneider family, who had operated a Munich brewery since 1864.

Today, Schneider Weisse still brews the family’s oldest recipe: Tap Seven, a dark wheat beer thought up by George Schneider I back in the 19th Century. In fact, the only thing to change here is the George running the show. At present, the brewery is run by George Schneider VI ­– and previously, all the George Schneiders in between.

What makes Schneider's wheat beers superior to most is their commitment to open top-fermentation. While many wheat breweries have industrialized the process and seal off the beer during fermentation, Schneider Weisse opts for the slower, traditional process, keeping their shallow beer tanks open to offgas and thereby capturing unique flavours from the air. And while they stick to the Reinheitsgebot, too, Schneider Weisse focuses on the hops, the ingredient that can mimic certain fruits, a helpful complement to wheat beers.

“We can do huge things,” said Schneider Weisse’s beer sommelier Stephan Butz, who assured me that Tap Six ­– their most famous beer – has notes of banana from Hallertauer and Magnum hops, while Tap Five, which uses Saphir hops, delivers mango, passion fruit and pineapple flavours.

Butz sees no reason for Schneider Weisse to stray from beer purity laws, not with the availability of such diverse hops. Although he added, “When a German brewery wants to brew a beer not following the purity laws, they can go to Austria.”

There are other alternatives for breaking the Reinheitsgebot beyond sneaking across borders: brewers can produce a style of beer that predates the beer purity laws, like wit beer (similar to wheat beer, but with orange and coriander added) or the sour, white Berliner Weisse.

Or they can just call it something else, like the brewing sisters in Nessalwang do.

In this small village two hours south of Munich, the Meyer sisters are reinterpreting five generations of family-brewing tradition and five centuries of Bavarian beer history.

Since the late 1800s, the family has operated the Post Brauerei, now called Brau-Manufactur Allgaeu. Traditionally the brewery was passed from father to son. But when Stephanie and Kathrin's younger brother decided cardiology was his calling, the sisters took over, bringing with them a new way of thinking about beer and the purity laws.

One of their recent lines, Brau Katz, which is aimed towards women, mostly follows the purity laws, but also brews around the rules when inspired to do so. One of their beverages, made in collaboration with an Israeli brewer, uses honey and dates. Because it doesn’t comply with the Reinheitsgebot, they cannot call it beer but instead label it Biermischgetränk, which translates as shandy.

But while this might be a simple way to skirt the rule, many customers are proud of the Reinheitsgebot and “these [non- Reinheitsgebot] beers do not sell so well,” according to Kathrin.

The sisters are not just looking to the future, however, but are also inspired by the past.

“We have 10,000 years of history [in Bavaria], but Reinheitsgebot is only 500 years,” Stephanie said.

Their blonde lager Krauter Marchen is styled on a recipe from before the Reinheitsgebot, and includes three herbs from their Allgaeu region. One of the herbs – Brennessel – was typically thrown into the kettle during the Middle Ages to ward off bad weather. And while the superstition lacks credibility, the final product benefits from the peccadillo, resulting in a perfect light summer lager with fresh, herbal notes.

“They made fantastic, creative beers [before the law],” Kathrin said. “It's not right to forget all the recipes.”

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.