It's fashionable to bash municipal bonds. No less an authority than investor Warren Buffett said recently that he did not know how to value them. Newspapers are filled with gloomy stories about rising pension obligations, cities on the verge of bankruptcy and budget stalemates in New York and California.

At the same time, yields on municipal bonds are stubbornly low, with ten-year muni debt recently yielding just 2.75%, an uninspiring rate at a time of rising risk.

Should investors in munis bolt for the door? Not necessarily, despite the low yields. An investor could still safely hold a diversified portfolio of municipal bonds. And for residents of high-tax states like New York and California, munis offer a good haven, given that they are exempt from federal and state taxes. With federal taxes on the rise next year, this is likely to become more valuable.

"Yields are low, but what is the alternative?" asks James T. Colby, senior municipal strategist at Van Eck Global, which manages $500 million in muni exchange-traded funds. "With money market rates this miniscule, you can't afford to be out of the market. But you do need to be more discriminating."

To be sure, munis have become a riskier investment since the 2008 market crash. That's a big change from years past, when investors viewed them as a risk-free alternative to Treasurys or money market funds.

Defaults on municipal debt have been on the rise, reaching $8.2 billion in 2008 and $6.9 billion last year, up from just $526 million in 2007, according to Richard Lehmann, publisher of the Distressed Debt Securities newsletter, which tracks defaulted debt. Lehmann estimates this year's municipal defaults will be around $3 billion, a lower number but still high by historic standards.

Still, analysts note that even these elevated figures represent just a sliver of the market, with last year's defaults just a quarter of a percent (0.25%) of outstanding municipal debt. In contrast, corporate bond defaults were 11% of outstanding debt in 2009.

The low default figures may be surprising given the frequent headlines about states struggling with their budgets. States have projected budget deficits of $137 billion for fiscal 2011 and 2012, according to a recent report from the National Governors Association. Buffett and others have speculated that the federal government will ultimately need to bail out those states that are worst off.

"We are having some frightful headlines out of the state capitals, and muni investors are not used to this," says Colby. "This creates some volatility in bond prices."

But in many cases, Colby says, these headlines are just noise. Even those states in the worst straits like California and Illinois have provisions in their constitutions or statutes requiring them to pay their debts. In California, the state's constitution says bondholders come second only to the school system, so the state would have to empty its jails before it stopped paying its teachers. In Illinois, debt holders actually come first. Each state's laws are different, so investors need to do their own research.