I'll assume this happens in the U.S., since it's what I'm familiar with. I think other instances of prohibition would be a pretty good model.
- Rich people would quickly find legal loopholes allowing them to continue using coffee without interference. During America's alcohol prohibition period, it was decided that whiskey had some medicinal benefits, so it could be prescribed by a doctor and filled by pharmacies. Some pharmacies had doctors on site who would "diagnose" their customers with conditions requiring an alcohol prescription and then fill the prescription right there. (Using this strategy, Walgreen's went from an obscure local pharmacy chain to an international company that's ubiquitous almost 100 years later.)
Figure: Prescription form for "Medicinal Liquor."
- Conversely, enforcement would focus on ethnic minorities and other unpopular social groups. In an effort to retroactively justify the practice, variants of coffee popular among these groups would be profiled as "more dangerous." Cafe con leche would be treated much more seriously than the nearly identical caffe latte. (Compare the discrepancy in the way various versions of cocaine are treated legally, or for a lighter example the social panic over Four Loko versus Red Bull and vodka.)
Figure: Cafe con leche. (Photo by mariosp on flickr, licensed cc-by-sa.)
- With the closing of the cafes that occupy most street corners, we'd see a sudden explosion of urban blight. In some locations with solid fundamentals, you'd just see unnecessary bank branches popping up, but you'd also see a bunch of crime concentrated around all the newly abandoned buildings, like in present-day Detroit.
- Large sections of the population would lose all respect for the government.
Figure: Prohibition-era protest
- Coffee trafficking would become a huge industry, given that South American cartels are already set up to smuggle drugs into the country, together with the fact that most coffee originates in South America. The market for coffee would presumably be substantially larger than for, say, heroin or cocaine, which would push the cartels beyond anything we've seen before. They would quickly supplant the legitimate governments of every country south of the U.S.
- Funding would be diverted from actual law enforcement just to enforce the coffee ban. Cities would build SWAT teams to raid cafes with federal anti-cafe funding, while actual crimes would go ignored.
Figure: Actual police SWAT vehicle. (Photograph by Simeon87 on Wikimedia Commons; licensed cc-by-sa.)
- Mainstream citizens would be afraid to speak about against the obvious absurdity of the situation, lest they be tarred as caffeine addicts and lose their position in society.
- After a couple of years, the political pressure against the ban would become too great and the ban would be repealed. Much of the damage to society, however, would be irreversible. Brutal ex-coffee traffickers would still control the countries to the south, unnecessary paramilitary-style local police forces would not be scaled back, and we'd probably have some residual restrictions, like, say, laws against minors drinking coffee.