I was gonna post a comment similar to this one on Reddit, but I didn't think it'd be appreciated. I think I'll manage to piss off both the Austrian school mises.org Libertarians and the I-always-get-screwed-by-corporations Liberals.

Free markets work when they transmit information with each transaction. When a factory owner raises his prices to cover rising costs, he's encapsulating information about everything that's happened further up the value chain. When a shopkeeper lowers the price he's willing to pay, he's encapsulating information about consumer demand and everything downstream in the value chain. If a new means of production becomes available that's more efficient than the old one, there's a profit opportunity available for the aspiring entrepreneur. And everybody has an incentive to pass on correct information, because otherwise it's their own bank account that will suffer. This appears to be the only way to organize an economy efficiently.

Free markets fail when transactions conceal information. For example, many subprime loans were made to people who had no conceivable way of paying them off, but mortgage brokers had every incentive to hide that information from the hedge funds who bought them, and didn't have to shoulder the risk of default themselves. Health-care patients have no way of knowing whether a particular procedure is medically necessary and no incentive to find out, because the insurance company pays for it. Microsoft customers had no way of knowing whether Windows is the best OS, because there were no alternatives (well, except Apple and Linux...pretend this is 1997 or so).

There's also the issue of transaction costs - it costs nearly as much money to collect tolls as it does to just build the damn highway, so the "information" that the customer sees is heavily distorted by the process of having to collect that information.

So, based on this, I can derive some general principles for the role of government:

1.) It should provide the institutional framework necessary for the market to function at all, eg. contract laws and defense.

2.) It should rectify the "lemon problem", where sellers conceal vital information from buyers or vice-versa, eg. consumer protection laws, implied warranties, truth-in-advertising laws, full disclosure on mortgages, SEC regulation, etc.

3.) It should prevent companies from leveraging a monopoly to enter a market.

4.) It should rectify externalities, where a firm takes something of value to others but doesn't pay for it, usually because it's too difficult to arrange a transaction. The classic example is pollution.

5.) It should provide goods and services where the transaction cost of attempting to measure and restrict usage is greater than the actual value of the service. Markets will never develop in these areas otherwise. A good example would be roads.

Some concrete examples, which'll probably seem kinda out-there:

To start, I wouldn't have any taxes at all. Instead, the government owns all land, and raises revenue by auctioning off leases on land, natural resources, and pollution credits. These leases would be tradable, subdividable securities, and would be subject to normal SEC prohibitions on disclosure and insider trading. If you wanted to construct a skyscraper that you expect to last 50 years, you'd buy a 50-year lease on the land. If you ended up selling it after 20, you could sell the lease on the open market, but the land itself would revert back to the government after another 30 years. The government can also buy the lease back by paying market rates.

This helps the externality problem, because every time the voters want to prevent something like a polluting factory, they have the legal ability to, but they also have a precise dollar figure for how much it'll cost, in economic terms. If people don't want oil companies to drill in the Arctic National Wildlife Refuge, they can simply block the lease on drilling rights, but it will cost them a few billion dollars. Then they can decide whether the economic value to oil companies is worth more than the government services they will receive from it.

As for spending itself - roads are an obvious one, because the transaction costs of tolls are hellish. Defense is another one - I don't think we need to spend quite so much as we do, but we do need a strong military.

I would not provide free education, other than the basic literacy and civic requirements necessary for democracy to function. You tend to get what you pay for. Free education not only leads to bureacratic, uncaring schoolboards, but it also leads to freeriding, uncaring schoolchildren.

Instead, I'd create rigorous public evaluations of all schools - not necessarily tests (which generally reflect the politicians' biases more than actually useful information), but statistics about where graduates end up, satisfaction levels, evaluations from past students, etc. Then let people choose - and spend their own money - on schools. Since people shouldn't be denied education based on what their parents do, there should be loans available - but through the private sector, not public.

Also, education has a problem in that it takes years for it to pay off, and market conditions can change dramatically between when you enter and when you exit. To insure against this, I'd create a tradable derivative called "salary futures" (again through the private sector). This is not insurance on your salary (that would have a huge moral hazard problem), but rather a promise to pay the change in the difference between the average salaries of two professions. These can be bundled into funds if necessary, to diversify across the whole economy. So if you want to become an engineer but find that salaries have gone way down by the time you graduate, your salary future will kick in with the difference for X number of years, and then you can decide whether to stick with it or retrain as a lawyer.

Health care is tricky because nobody wants to die, and if life really is priceless, then people should be willing to pay infinite amounts of money to avoid dying. Markets aren't meant to deal with infinities. I'd need to think about this; I suppose if I actually came up with a workable solution I'd be rich and famous and wouldn't be posting it on a glorified message board. ;-)