Charlie was supposed to get the ticket
I guess it's assumed or nobody cares because it's a movie, but I am watching this again and it's pretty obvious to me Charlie was picked by Wonka from the get-go.
1. The scene where he goes in to buy the candy he asks for a second one and the guy gives him a different candy bar than he previously ordered. It was also sitting on a shelf away from the others stacked behind it. So if Charlie hadn't ordered that candy he would have insisted on it the next time Charlie showed up at the store.
2. Charlie happens to live in the very town the factory is in. Willy had been watching him for a long time. In fact, I suspect the Candyman was the inside man.
3. Slugworth is already waiting for him right when he gets the ticket. I mean, he's not at the press conference the next day but right when Charlie pulls it out of the wrapper.