The ban was scheduled to take effect on Tuesday.
In the decision, the judge wrote that Bloomberg's sugary drink regulations are "fraught with arbitrary and capricious consequences. The simple reading of the rule leads to the earlier acknowledged uneven enforcement even within a particular city block, much less the city as a whole."
Judge Milton Tingling added that the ban raised concerns because it would apply "to some but not all food establishments in the city, (and) it excludes other beverages that have significantly higher concentration of sugar sweeteners and / or calories on suspect grounds..."
Shortly after the ruling, Mayor Bloomberg's office tweeted, " We plan to appeal the sugary drinks decision as soon as possible and are confident the measure will ultimately be upheld."
The judge also questioned the health department's authority to issue the "portion cap rule."
"The court expressed concern about the administrative agency having a virtually limitless authority," he wrote. "The Portion Cap Rule, if upheld, would create an administrative Leviathan and violate the separation of powers doctrine. The Rule would not only violate the separation of powers doctrine, it would eviscerate it. Such an evisceration has the potential to be more troubling than sugar sweetened beverages."
During a press conference Monday evening, Mayor Bloomberg said, "We believe it's reasonable to draw a line, and it's responsible to draw a line right now. With so many people contracting diabetes and heart disease, with so many children who are overweight and obese, with so many poor neighborhoods suffering the worst of this epidemic, we believe it is reasonable and responsible to draw a line, and that is what the Board of Health has done. As a matter of fact, it would be irresponsible not to try to do everything we can to save lives."
The city Board of Health approved the measure in September, following on other efforts by the Bloomberg administration to improve New Yorkers' eating habits, from compelling chain restaurants to post calorie counts on their menus to barring artificial trans fats in restaurant food to prodding food manufacturers to use less salt.
"We are confident the Board of Health's decision will ultimately be upheld," said Michael A. Cardozo, the city's corporation counsel.
The city had said that while restaurant inspectors would start enforcing the soda size rule in March, they wouldn't seek fines - $200 for a violation - until June.
Monday's ruling came as barbecue joints, coffee counters and bottle-service nightclubs were preparing for the clampdown. Some restaurants ordered smaller glasses. Dunkin' Donuts shops told customers they'll have to sweeten and flavor their own coffee. Coca-Cola had printed posters explaining the new rules.
"The restaurant industry is happy and vindicated by the decision today, which not only overturned the ban but emphatically stated our main arguments that the ban was arbitrary and capacious and a broad overreach of power by the Board of Health. We hope we can put this behind us and focus on productive measures to fight obesity," Andrew Moesel of New York State Restaurant Association said in a written statement.
City officials had described the ban as a pioneering, practical step to staunch an obesity rate that has risen from 18 to 24 percent in a decade among adult New Yorkers. Health officials say sugar-filled drinks bear much of the blame because they carry hundreds of calories - a 32-ounce soda has more than a typical fast-food cheeseburger - without making people feel full.
The city "has the ability to do this and the obligation to try to help," the plan's chief cheerleader, Mayor Michael Bloomberg, said last month.
Critics say the regulation would not make a meaningful difference in diets but will unfairly hurt some businesses while sparing others. A customer who can't get a 20-ounce Coke at a sandwich shop could still buy a Big Gulp at a 7-Eleven, for instance, since many convenience stores and supermarkets are beyond the city's regulatory reach.
New Yorkers have been divided on the proposed restrictions. A Quinnipiac University poll released last week found 51 percent opposed it, while 46 percent approved.