Hot air is thinner and lighter than cool air.
When you seal the can, the air inside is hot. That means there are fewer molecules of air inside the can than there would be if the air were cool. As the air inside the can cools, it pushes less hard against the inside of the can than the air outside the can is pushing. We created a partial vacuum in the can to see how well the material holds up when the pressure on the outside is greater than the pressure on the inside. Hot air molecules have more energy than cool air molecules.