The Federal Constitutional Court's decision stated that changes to the state's ban, based on an appeal by a restaurant owner, can legally remain in place.
A state parliamentary decision went into effect on August 1, changing the general ban to allow smokers in pubs smaller than 75 square metres, in addition to restaurants and beer tents that create smoking sections in side rooms. Children are not allowed in smoking areas.
The state Health Ministry will now also allow smoking at establishments that can insure limited second-hand smoke with special ventilations systems.
Smoking in public areas is still strictly forbidden, according to the court.
The legislation has been roundly criticised by anti-smoking advocates, but many voters in the state were in favour of dropping the ban.
A loophole in the ban created a wave of members-only smoking clubs, but the new law no longer allows these.
While smoking was banned in bars and restaurants in most German states starting January 1, 2008, the restrictions have been widely flouted. For example, many bars in Berlin set ashtrays on the tables after dark. And legal exceptions in many states have also weakened the smoking ban.
Six months after the ban began, courts ruled against the restrictions in Berlin and Baden-Württemberg, allowing smoking in bars smaller than 75 square metres (807 square feet) where no food is served.
Many German smokers also responded by starting grassroots groups and petitions to roll back the ban.