Much of racing's history in the United States deals with preventing abuses that otherwise might have extinguished the Sport of Kings. Mostly they were problems with betting and with unfairly tampering with the races themselves, i.e. fixing races. Horse racing, much like other individual performance sports such as boxing, are particularly susceptible to this form of corruption.
In as much, the United States outlawed bookmaking almost everywhere for a century or more.
This is in large part because bookies often stole from their customers. They were viewed as criminals, often deservedly, and occupied space on the social scale somewhere between pickpockets and gangsters.
In the 19th century bookies not only took bets, but were the source of handicapping information and the outcomes of the races. Thus, a bookie could tell a winner that his horse had lost and keep the winnings for himself. Or the bookie might have just pocketed the bet without registering it at the track, hoping that the horse would lose anyway.
On a larger scale, established "bookmakers" were somewhat like bankers, where the clients could lose their money if the book was poorly managed or failed altogether.
Some of them offered odds different from the "true odds" (back then, a slippery concept indeed), creating an opportunity to profit from arbitrage between the client and the track. The bookie could move a line against a customer (make the odds less favorable) just because he knew that the customer preferred a certain kind of bet, and would not notice or complain or question the loss of part of his edge. But if a customer then won big, the book could lose a lot of money, either its own or that of its other customers.
Some of these practices are still possible, in theory, in sports and race books today; but as the books are regulated by gaming commissions in the states where they operate legally, the worst abuses are much less likely. In this respect, Vegas has probably some of the most professional bookmakers in the world. Not only is the business competitive and the market demanding, but shenanigans are not tolerated by the Nevada Gaming Commission as gambling is so fundamental to the states economy.
It's interesting to note that in the UK, bookmaking is still considered a respectable occupation, though it is also closely regulated. Online bookies are for the most part regulated only by the marketplace so history and reputation count.
In the "old days," almost any trick was tried, at least once. A horse might be disguised as some other horse and run in a race, or an animal might be drugged to enhance or impede its performance. Abuses grew steadily as organized crime made inroads into the horseracing business. It was this influence of underworld figures that led most states to outlaw betting on horse races. Around 1900 many legislatures did not stop there, but following the fashion of prohibiting "vices" of all sorts, they banned all horseracing, and maybe even all kinds of gambling. Nevada, for example, forbade gambling altogether in 1909. In states where racing survived prohibition, it was subjected to regulation. For example, in virtually every state that authorizes horse races, each horse must have an identification tattooed on the inside of its upper lip, which must be checked prior to every race.
Just as the states were busy regulating races, so also the tracks, the owners, the breeders and the jockeys organized themselves into associations or unions, which advocated standardized procedures to keep racing safe, honest and attractive to fans. As a result, the general public can place confidence in the integrity of sanctioned horse racing. While some may scoff at the concept self-regulation, it's not a joke - provided the proper incentives are in place and the market is what the call in economics "inelastic". While in many industries self-regulation doesn't work because a few major players can get together and collude around goods or services people must have, happily gambling isn't one of these industries. While there are always rouges and fly by nighters, cheating on an industrial scale doesn't exist.
Because the Constitution reserves to the individual states the power to regulate conduct within their borders, the federal government did not try to ban bookmaking directly. Instead, using its authority to regulate "interstate commerce," Congress passed several laws to stop interstate travel in aid of racketeering and gambling, the movement of gambling equipment across state lines and, in 1961, the use of a telephone or telegraph to support a gambling activity. This last measure is called the "The Wire Act." It is what prevents you from being able to call in a wager to a Las Vegas race book, as the telephone system is thought to be in "interstate commerce."