Maryland Gov. Larry Hogan in April. (Katherine Frey/The Washington Post)

FOR YEARS, states have given online travel agencies such as Travelocity and Expedia a nice tax break — and an undeserved windfall. Rather than collect sales taxes from the agencies based on the actual prices they charge customers for hotel rooms, most states have accepted a reduced payment based on bargain room prices the agencies manage to negotiate with hotels. The companies, which mark up the room rate for customers, have pocketed the difference.

Nice work if you can get it, and no wonder the online agencies have scratched and clawed to retain what amounts to a sweetheart subsidy, courtesy of state taxpayers.

You can’t blame them for trying, but logic and equity are on the side of states that demand, justly, that online agencies remit taxes on the full payments they receive for room sales, not the discounted prices.

Maryland lawmakers moved this year to correct this anomaly, which took root owing largely to legislative language that predated the Internet. Backers of the measure noted, correctly, that it would put hotel chains such as Marriott, whose headquarters is in Maryland, on an even competitive footing with online agencies. The hotel chains charge customers Maryland’s full 6 percent sales tax on hotel rooms and pass those payments along to the state.

The online agencies have cried foul with backing from their much smaller brick-and-mortar kin and with amplification provided by legions of Annapolis’s highest-priced lobbyists. They claim, disingenuously, that the bill amounts to a job-killing tax hike, thereby tailoring their message to appeal to Gov. Larry Hogan, a Republican who ran on an anti-tax platform.

Predictably, doctrinaire anti-tax groups have also leaned on Mr. Hogan, warning him that signing the measure would be an act of heresy. Most Republicans in the General Assembly kowtowed to that message and opposed the bill in the Democrat-dominated legislature. So far Mr. Hogan has not tipped his hand.

He should sign the bill. The financial stakes are small — it would yield just $3 million to $4 million or so annually for the state coffers. But those millions would otherwise come out of the pockets of taxpayers, who until now have been subsidizing travel agents, for no good reason. That’s unfair.

The bottom line is that travel agents are collecting a sales tax from customers, although they prefer to muddy the waters by calling it a booking fee. Most other businesses are required to remit the taxes they collect on their sales to the state. Why should travel agents be exempt?

The agents may have become used to this comfy arrangement. That doesn’t make it right or equitable. It’s just a loophole.