Smoking, drinking, gambling, and other vice-like habits are widely believed to be harmful — not just to the individuals who drink, smoke, or gamble, but to society at large. Some states levy so-called “sin taxes” on such products or otherwise profit from such behaviors. Whether these taxes effectively deter residents from harmful behavior, or whether tax policy is the appropriate tool to address such problems, may be open questions. Whether the state is right to profit from such behavior is yet another question. In any case, a handful of states have profited immensely from these tax policies.

24/7 Wall St. reviewed state revenue from tobacco, alcohol, and casino taxes. We also considered profits from state-owned liquor and lottery systems. In a few states, massive marijuana industries have formed in the last several years, and have recorded extraordinary profits. However, even considering those revenue streams, Alaska, Colorado, Oregon, and Washington — the four states where some form of recreational marijuana has been legalized — did not make this list. Rhode Island leads the nation with $858.7 million generated from such sources, accounting for 9.5% of the state’s total revenue. Michigan rounds out the list in ninth place with 3.4% of annual revenue generated from taxing behaviors deemed harmful to society. Nationwide, 2.3% of government revenue comes from supposed sins.

Of the potentially harmful behaviors considered, gambling is most frequently the largest source of sin-related revenue for states. Lottery sales, which are nearly always controlled by state governments, or casino taxes were the largest drivers of revenue in all but two of the nine states.

Nationwide, the government generates profits of $21.3 billion from lotteries and casino taxes, or approximately 1% of total revenue. Lottery ticket sales alone accounted for less than 3% of revenue in only one of the states profiting the most from sin.

6. Pennsylvania

> Pct. total revenue from sin: 4.1%
> Most profitable sin: Casino taxes
> Revenue from sin: $3.69 billion (3rd highest)

Due to its relatively large population, Pennsylvania’s total revenue from taxing behavior and products deemed harmful to society totalled $3.7 billion in 2014, higher than in all but two other states. The state collected $1.5 billion from casinos alone, the highest total of any state. According to Pennsylvania’s Gaming Control Board, gamblers playing slots at the state’s 12 casinos wagered a total of $27.8 billion for a payout of $25.1 billion over the course of fiscal 2015 and through May 2016.

Like in many other states, liquor stores in Pennsylvania are state controlled. Unlike most states, however, the arrangement is not especially profitable. Pennsylvania liquor stores lost $288.8 million on $1.8 billion in revenue in 2014. Taxes on alcoholic beverages, which accounted for an above-average 0.4% of the state’s total revenue partially made up for the liquor store loss.

Using tax policy to regulate behavior is controversial. The added taxes increase the cost of consuming unhealthy products such as cigarettes. For proponents of such tax policies, this generates more revenue to fund government programs, while discouraging people from engaging in such harmful activities at the same time. Some states may have had a modicum of success penalizing these behaviors, as the 10 states with the highest tobacco tax rates all have below-average smoking rates.

There are plenty of exceptions, however. Michigan, for example, levies one of the highest tax rates on spirits. Yet, liquor sales in the state are higher than in all but only a few states and make up one of the largest shares of state revenue. Similarly, in Pennsylvania, a high tax on alcohol was seemingly not needed to discourage drinking. The state reports one of the lowest excessive drinking rates and also has one of the lowest tax rates on beer and liquor.

For some, taxing these behaviors is the wrong approach even if it does effectively lower the likelihood of people engaging in harmful activities. In a report published in 2012, Scott Drenkard, a researcher at the Tax Foundation, argued that tax policy is a crude instrument and should not be used to regulate people or guide them towards healthier choices. For Drenkard and like-minded Americans, not only is the question of what is healthy complex and varied, but also the responsibility over this decision should be left to the individual.

Still others hold that state-run control over so-called sin industries is problematic. Critics of state-run lotteries, for example, cite to the fact that regular lottery participants are often low-income, poorly educated individuals, and are therefore taken advantage of by the governing body elected to serve in their best interests. Lotteries are in a way a sin tax on gambling, in that states use the proceeds to fund public programs. But unlike excise taxes such as those levied on tobacco and alcohol, state lottery systems strongly encourage this often unhealthy behavior.

To identify the states profiting the most from sin, 24/7 Wall St. reviewed state tobacco taxes, alcohol taxes, casino taxes, as well as proceeds from state-controlled liquor stores and state lotteries. Tobacco, alcohol, liquor store and lottery income came from the Census Bureau’s State Government Finances report. Casino taxes came from the American Gaming Association’s “State of the States” 2012 report. All other figures are for fiscal year 2014, the most recent year for which there are consistent data available for all income. 24/7 Wall St. also reviewed excise tax rates from the Tax Foundation, with rates current as of January 1, 2016. We also reviewed alcohol consumption data from the Center for Disease Control. These are not the only allegedly sinful activities states profit from. Tax revenue and profits from state sex industries were not considered due to lack of data.

Click here to see the 9 states profiting from sin