I have no idea whether or not this pseudononymous account is true, but GeekPress links to a story by a self-proclaimed mafia programmer who sets up and runs illegal book-making operations in New York City. The narrative is interesting, but what stood out most to me was near the end:
The fact remains that I could be pulling in $150,000 as a programmer on the open market. But I make a third of that. So why am I risking a prison sentence or the potential of a lifetime in witness protection for a job that doesn't make me all that rich? Simple: When you start making a lot of money, you get noticed by the biggest bullies on the block - the cops and the IRS - and I don't want that. I like living below the radar. I sublet a friend's apartment and pay his utility bills with money orders that I purchase at the post office or at one of those check-cashing storefronts. Because I get paid entirely in cash, I don't fork over any taxes. When you get right down to it, I'm an idealist. I don't condone the actions of the US government. By refusing to pay taxes, I withhold my financial support. And, truth be told, I like mobsters. They're more willing to accept you at face value. They aren't hung up on college degrees, or where you live, or how many criminal convictions you have.The police and the IRS are, in a sense, the big dogs on the block, and this final paragraphs illustrates that they're performing their jobs adequately. Contrary to popular belief, the purpose of law enforcement isn't to completely eliminate crime -- it's to make crime unprofitable, in the aggregate. People such as "Simson Garfinkel" may still break laws due to "principle", but that's because their sense of profit is non-standard; the satisfaction they get from breaking the law is more "profitable" to them than the money they're sacrificing. Most people, however, are in it for the money, whatever it happens to be.
When society outlaws some behavior, it attempts to increase the transaction costs of that behavior and thus render it unprofitable. The purpose of law enforcement is to make the cost of breaking the law times the chance of getting caught and convicted higher than the benefit of breaking the law times the chance of getting away with it. That an illegal bookmaking operation is forced to give better odds than can be found in legitimate gambling (according to the story), and that the operator makes less money than his skills would otherwise earn, is a testament to the effectiveness of law enforcement.
Similarly, consider the War on [Some] Drugs, which props up street prices for chemicals that are relatively cheap and easy to manufacture, and thus arguably reduce their consumption. That's the theory anyway, and as long as prices are kept high enough it'll work. Obviously there are other factors involved in this form of prohibition, and as with any law society needs to weigh the costs and benefits of the law itself (but that's a different issue).
On the other hand, think about the enforcement of traffic laws. Because of the way they're enforced, it's obvious that most traffic laws are designed more as a source of revenue than for the protection of the public. For example, the vast majority of drivers decide that the benefits of speeding outweigh the costs of getting caught; almost everyone speeds. The explanation for this is pretty simple: everyone sees their time as valuable and not-to-be-wasted driving more slowly than necessary, and everyone knows there's only a miniscule chance of being caught in any particular instance. Thus, laws against speeding are ineffective and disrespected, and everyone knows it. The only reason they're kept around is to provide revenue for cities -- in a sense, they're an arbitrary, randomly collected tax. For this reason, I think speeding laws are unjust. If society really thinks it's important for people not to speed, we need to vote to increase the penalties enough so that the laws will be effective, even with sparse enforcement. For example, if the penalty for speeding was spending a year in jail, I expect speeding would be reduced dramatically.
Of course, this will never happen because no one thinks speeding is a big enough problem to punish effectively. We live in a democracy, where social right and wrong are defined (generally) by the will of the majority. If the majority doesn't believe speeding is worth discouraging effectively, and speeding laws are widely ignored and disrespected, there's no moral compulsion to obey them -- because the laws themselves are unjust. I believe we have a moral duty to drive safely, but the more restrictive legalistic details depend on the form of government any particular individual happens to live with.
In contrast, consider illegal book-making. According to the story, accepting 5 illegal bets in a single day is a felony, punishable by up to 3 years in prison. That level of punishment (times the level of enforcement) apparently leads to such ventures being unprofitable, which in turn indicates that society takes the crime seriously. Therefore, we have a obligation to obey the otherwise morally neutral restriction of our freedom (not that I think it's a great restriction).