No doubt, jealousy is playing a huge role. It's hard to fault him and difficult to confront seeing as you've also deceived him. You've gone behind his back without his knowing and tried to do some investigating.
What that shows, first off, is a serious lack of trust between the two of you.
Now, to the issue of why he would lie to you....First, we aren't sure he's the one lying. It could be his ex. Second, he may be lying to protect you. Many people, men in particular, will lie because they either are afraid of how the other person will act, or they are trying to hurt the other person.
In this case, it looks like he was trying to avoid confrontation, and try to reveal as little as possible so you wouldn't get hurt.
there is actually an article that sort of talks about this and other
secrets men keep at AdviseCouples.com