First of all, stop punishing him for wetting his pants. He is not doing it on purpose. Of course he lies when he thinks he's going to be reprimanded. Kids at this age do not yet have a firm understanding concerning lying. We are still teaching them the difference between a lie and the truth. Notice we're teaching; not punishing. Each time he wets his pants don't ask him if he has. Then he doesn't have a chance to lie. Change him into clean clothes while being sympathetic about having this happen.
If you think he's doing this on purpose it's time to figure out why he'd want to wet his pants. It's common for children to not want to interrupt play. Make it a game to use the toilet ever couple of hours or so. Race him to the bathroom is one idea. Give him a hug and a star each time he makes it on time. Treat the accidents as no big deal.
Some urinary incontinence can be helped with training the bladder to empty every couple of hours. A doctor can give you more information on this.
Have you taken him to the doctor to see if he has a medical problem, such as a small bladder or an inadequately developed sphincter muscle? The pediatrician will have some ideas for you.
The most important thing for you to do is to accept that this happens without blaming or punishing him. Don't set him up for feeling that he needs to lie. And don't accept the lie or make a big deal of that either. Be empathetic, showing him that you know he's not doing this on purpose and that you're on his side and want to help him remain dry.