Kids up through 5 or 6 simply don't have the same fix on reality that adults do, and tell grownups what they want to hear, or what the kids themselves wish were true. They want to make us love them. My agreeable, cooperative and polite grandson still does this at 4.5, and I'm not the least bit worried. If he were 7, I'd be leaning on him harder.
Rather than punish for what he shouldn't do, I simply explain what he should have done (or should do next time), and why. I would never punish for a first infraction, because to the child, that seems totally arbitrary. Getting punished for something you didn't yet know was wrong would seem outrageously unfair to an adult, too.
I'd like to argue your son's side of it for a moment. He was having fun with his friends. Hiding is a game. Cooperating with the teacher in a fun place like preschool is more a matter of all being on the same fun team than knuckling under a ponderous list of rules. The teachers (ideally, anyway) are trying to instill a love of learning, socializing, and cooperation. So, he was socializing, being creative, and surely meant no harm.
Now that he knows his actions caused the grownups to be unhappy with him, he's not too likely to repeat that behavior, and next time it would be reasonable for the teacher to determine an immediate consequence. A good teacher has the training and experience to handle this sort of situation, and it doesn't sound like it was such a big issue that she even needed to talk to you about it. Kids so young are pretty immediate in their thinking and behavior. A delayed consequence hours after the fact will just be confusing and unnecessarily punitive.
One last thought; if we really want our children to understand lying, it's probably not a good idea to force an apology. It's great to explain the purpose of an apology, and ask the little one to apologize when he feels sorry and wants to make things better. But an insincere apology is, essentially, a white lie.