The Bavarian Duke Wilhelm IV proclaimed the Reinheitsgebot in 1516. Also known as the Bavarian Purity Law of 1516, it proclaimed that brewers could only brew beer that contained water, barley and hops. When Bavaria and Prussia later joined Germany, it did so on the condition that the beer purity law applied to all of Germany.
The 1516 proclamation in Ing was not the first requiring beer to include these three ingredients. But it is the one that became famous. In 1487, Duke Albrecht IV passed a beer pricing law requiring brewers to take an oath that beer would only contain barley, hops and water. Duke George the Rich enacted a similar law of beer purity for Bayers-Landshut in 1493.
The proclamation happened before Louis Pasteur discovered the importance of yeast to alcoholic fermentation in 1857. The law was eventually modified to allow the use of yeast as well. In addition, distinctions were made between the allowable ingredients for beer using top-fermenting or bottom-fermenting yeast.
Although touted as a law to maintain beer quality following World War II, and still the standard used by some German brewers, the original purpose of the law was probably to keep prices low at bakeries by limiting the use of wheat and rye to bread. Food scarcity was a problem in Bavaria at the time. Wheat and rye are far better for baking bread than barley, which isn’t easily digested. After World War II, Germany was looking to export more beer to improve its economy. The craft beer movement was gaining popularity in the United States. So marketing the law as improving the quality of the beer and keeping it pure made sense.
At one point, it was was the oldest food quality regulation remaining in the world. But a European Union court decision modified the purity law for imported beer in order to maintain free trade among EU member countries in 1987. It was then replaced by the Provisional German Beer Law of 1993, which allows German brewers to use additional ingredients when making beer.
Here is the translation of the Reinheitsgebot from the Augustiner website.