"I'm a bit confused about this online play because I've read it is not illegal"
Welcome to the club!
I played online poker and it was simply setting up an account and using a regular bank checking debit account to deposit money into the online poker account. I could withdrawn from the poker account and the money would be in my debit account in less than three days. It was a legal transfer of funds for gambling to and from U.S. banks to foreign banks until Congress passed the Unlawful Internet Gambling Enforcement Act in 2006. The legality of gambling online depended on the interpretation of the Interstate Wire Act of 1961 and it wasn't enforced on casino type, poker, and Bingo gambling.
In 2006 the majority of online gambling sites closed their doors to U.S. players because the monetary transactions were illegal, but some of the poker sites continued by finding a way to launder the monetary transactions. On April 15, 2011, the Feds seized the Internet domains of these poker sites preventing anyone in the world from playing. The poker sites were open the next day, but closed to all U.S. players. In September 2011, the Justice Department released an opinion on the scope of the Wire Act and it only applied to sports betting and not to other types of online betting.
The Unlawful Enforcement Act "prohibits gambling businesses from knowingly accepting payments in connection with the participation of another person in a bet or wager that involves the use of the Internet and that is unlawful under any federal or state law." and according the JD, anything but sports betting is legal.
Betting on U.S. horse racing online added to the confusion; it was never called illegal because it wasn't clarified in the Unlawful Enforcement Act and U.S. companies continued running the sites. That type of online betting continued after 2006, after Black Friday and anyone in the U.S. can open an account today and legally bet on horse races.
Many of the states created legislation making Internet gambling illegal before the JD interpretation, but betting on horse races was excluded. Because of the JD interpretation, some states created legislation that allows Internet gambling within their borders. It's legal to play online poker in Nevada but not if the computer is in Utah. It's legal for Illinois residences to purchase lottery tickets online, but illegal to for Kentucky residences. However KY residences can go into Illinois and purchase lottery tickets. It's so confusing, a simple explanation of it all, is as clear as mud.