Yes, in most states (and Canadian provinces) it is illegal to require anyone to "pay" to enter a lottery like that (a game of chance), mostly because the states have reserved for themselves the easy take from lottery sales. If they charge you ANYTHING to enter, it is an illegal lottery.
There are some minor exceptions for non-profit organizations. There is a big exception for games of "skill", "knowledge" or "strength", such as the ring-toss at a carnival. Some contests use this exception to get around the rule against no entery fees by, for example, asking a question that nearly anyone would know the answer to, and charging money for a chance to win the big prize, if you "know" the correct answer.