LAST YEAR, nearly 3 million people walked through the gates of Fenway Park to watch the Red Sox, as bad as they were. More than 720,000 fans spun the turnstiles at TD Garden to watch in frustration as the Bruins failed to make the playoffs, while about the same number cheered the Celtics on to a seventh-place finish. Down in Foxborough, 550,000 spectators jammed Gillette Stadium for the Patriots’ eight home games for the 2014 season, and that doesn’t include preseason or postseason.

The Boston area has some of the country’s most loyal sports fans. It is the only region in the nation that played last year to 95 percent or higher capacity in all four major sports. Over the years, the fans’ faith in their teams is often taxed, but never their tickets. According to the Federation of Tax Administrators, Massachusetts is one of 11 states that does not levy a tax or surcharge on sporting events. In fact, a special exemption is written into state law barring taxes on tickets for sporting events, theater showings, and other amusements.

Some states subject sporting events to the sales tax, others have a separate amusement tax, and a handful levy a flat surcharge ranging from $1 to $3.50 per ticket.

If professional sports tickets in Massachusetts were subject to the state’s 6.25 percent sales tax, the state could reap more than $21 million a year from the nearly 5 million fans who went to major professional games during the last season, based on average ticket price.

The ticket tax exemption has been part of the law for decades. A spokeswoman for the Department of Revenue confirmed the agency has repeatedly affirmed the exemption for sporting events in rulings dating back as far as 1981.

Even tax-averse states such as Texas, Arizona, and Florida hit ticket-buyers with a tax. Delaware, which has no major sports franchise, levies a .384 percent tax on gross ticket receipts of $50,000 or more a month. The highest ticket tax is in Maryland, which hits fans with a 10 percent tax on the ticket price, though much of the revenue is dedicated to paying the debt service on the Baltimore Orioles stadium at Camden Yards. Nevada also has a 10 percent tax, but that applies to venues that seat up to 7,500 people; it drops to 5 percent for larger venues and there is an exemption for NASCAR events and minor league baseball games played in a stadium.

Several states permit counties or municipalities to levy a ticket tax, often to pay for bonds that were issued to build a stadium. In Arlington, Texas, for instance, voters approved a 10 percent ticket tax on baseball and football games to pay for the city’s $325 million portion of the $1.2 billion Cowboys stadium. That tax was on top of the statewide 6.25 percent sales tax that has no exemption for tickets and which goes to the general fund.

Most states have an exemption for sporting events put on by nonprofits. Florida has an exemption on Super Bowl tickets if the game is held in the state.

Of the other states that exempt sporting events, only two—Maine and Rhode Island—do not have major sports franchises. States that do not tax tickets include New York, California, Illinois, Indiana, Colorado, Michigan, Pennsylvania, and Ohio.