Mark Thoma's recent article in the Fiscal Times does a great job of laying out the typical case most undergraduate economics majors hear for government intervention in markets. Undergrads are taught the requirements for perfect competition in markets: an infinite number of buyers and sellers, perfect information, price-taking behavior by firms, etc. Thoma is quick to point out that these conditions are not often found in real-world markets, thus government intervention is necessary to correct the failures of real-world markets to live up to these ideals.
As Farmer Hayek readers might expect, I didn't find his arguments terribly convincing. First, this is a classic case of the Nirvana fallacy. The real world will never live up to any perfect ideal. The policy-relevant comparisons are thus not between this impossible ideal and real-world markets, but between alternative policy regimes that actually exist or could exist.
Another way to look at this issue is to consider what Ronald Coase called "blackboard theory" in his Nobel Prize address. Focusing on highly abstract theory, with little attention paid to the real world or the effects of the institutional environment, makes it far more likely that we will miss important insights. (For more on this subject, check out Arnold Kling's short piece here or Pete Boettke's longer article here. Both are definitely worth reading and are accessible to the interested layman.)
For instance, the presence of asymmetric information between buyers and sellers in used car markets might lead one economist to the conclusion these markets are inefficient and that a policy should be designed to rectify this inefficiency. Another economist might see this asymmetric information as an explanation for the voluntary use of warranties by dealers or to the establishment of companies like Carfax (which has been around since the mid 1980s). The first economist is focused on the world in the model, while the second uses the model to make sense of the operation of a particular market in a given institutional environment.
This brings up another issue. While markets can certainly be inefficient when compared with an unrealistic ideal, the government (which is charged with solving these inefficiencies) is itself imperfect. The Public Choice school has done a great job detailing the ways in which government institutions fail to live up to their idealized functions. Unfortunately, the most popular undergraduate textbooks don't cover this important component of economic theory.
Markets and governments are both imperfect in that they don't stand up to criticism by idealized models. A focus on real-world institutional arrangements and market and policy outcomes, rather than blackboard theory, avoids the Nirvana fallacy and can lead to better (less?) policy design. Further, when market activity is understood as a dynamic process, we can see that markets (free of government regulation but certainly regulated by voluntary formal and informal institutions) are more likely to produce outcomes consistent with resource scarcity and consumer preferences.