Bavaria introduced the so-called 10H rule in November 2014 which Hans-Josef Fell, former federal member of parliament for the Greens Party and Patrick Friedl, Green Party member of the Wurzburg city council, challenged.
However, today, the constitutional court has rejected the challenge.
"In practice, this means the demise of wind expansion in the southern German state as growth has virtually stopped since the rule was introduced," said Eva Bulling-Schroter, energy spokeswoman for the Die Linke, an opposition party in the German federal parliament.
In the first half of 2015, around 275MW was granted approval in Bavaria, but only 25MW was permitted in the second half of the year, according to data published by DEWI in February 2016.
Over 370MW of onshore wind was installed in Bavaria in 2015 after 412MW in 2014.
The complainants had argued that turbines in inland areas with lower wind speeds could have heights of up to 200 metres.
Requiring a distance of two kilometres to the next building would virtually rule out wind developments by restricting possible sites to as little as 0.01% of Bavaria's area, and effectively annul wind energy's privileged status.
The court countered that the area remaining for privileged status is "significantly restricted but not eliminated".
The federal German government opened the door to such individual federal state arrangements in an amendment to the Construction Act 2014.
Initiated by Bavaria, it allows the federal states to pass laws under which the privileged status of wind turbines in non-urban areas (but outside nature and environment protection and other special areas) only applies when a certain distance to buildings is complied with.