Ohhhh my my. What a bad mother! NOT! I had the same thing happen to me. My son went ACROSS THE STREET (fortunately it's a quiet neighborhood in a cul de sac, but people do speed) and into a neighbor's unlocked door to play with her puppy. She heard giggling and discovered him. I was doing the laundry, so didn't hear the door opening. I came out and she was standing in the middle of my living room, asking where his mommy was. He thought I was outside, since I'd been outside talking to a contractor earlier that morning. How embarrassing. I had told my husband over and over we needed to get a second deadbolt or something because I knew how smart and capable he was. He thought I was crazy and wasn't going to drill holes in our beautiful door; no way. That day I went out myself and got the supplies. I knew the chain feature would do no good. There is this thing that looks like a door hinge, but is like a manual lock. When you close it, the hinge locks down so the door can't be opened, even if the door gets unlocked with a key or credit card, etc. It seems simple, and it is. It is also inexpensive. We put it high enough on the door where he couldn't reach it, even with his step stools. By the time he could reach it, he was old enough to know why he shouldn't open it. Now I have a second child, and I think it's saved us/her again. Oh, the other thing I bought that I'd been insisting on? A nice peephole - before, we had to look out our small window near the door. Now he agrees it was worth "ruining" our beautiful door. I got all of this at the Home Depot. I'm sure they can help you find it. For interior doors, I'd suggest changing the lock to one where you have to use a pin/key to open it, as they like to lock themselves in. That way, you can keep them out of rooms without them learning about how to get in.
I never tell my kids they are smarter than me...they know it. :-)