Sorry if this is long.
Have a serious talk with your roommate. If he doesn't begin locking the door, find a new roommate. It may be inconvenient, but if he will not learn, you need to take action to ensure your safety.
I posted in the other thread about my roommate leaving the door open and a drug addict making himself at home in our apartment. This incident occurred a few months after a much more serious one.
My roommate, "Jane," was out of town, so I was sleeping at home by myself. Before I went to bed, I checked all of the doors and windows to make sure they were locked. Except I didn't check Jane's bedroom window, as I didn't want to barge into her room and invade her privacy.
At about 3 am, the police burst through my bedroom door. Some guy had come in through Jane's window. He had removed all of the screens on the front windows, but he couldn't get in because they were locked. He easily got in through Jane's, though. My neighbors, whom I didn't really know, saw him, and he explained that he lived there, but he was locked out. They didn't think twice about it until he pulled out a flashlight once he was inside. If he had been smarter, I would have been in serious trouble.
Because the neighbors got a good look at the guy, the police were able to determine that he was likely the same person who had brutally raped and beaten a girl the previous week. The only reason he hadn't made it to my room is because he was taking his time going through Jane's dirty laundry and stealing her dirty underwear. When the police arrived, he ran, and they never caught him.
After that, I paid for additional locks on the windows, window alarms, chain locks on the doors, security bars, and censor lights. But those things were useless because Jane continued to leave the door unlocked. She never learned her lesson. This is a girl who was both puzzled and devastated when her grandmother's heirloom ring was stolen from an unlocked locker at the gym and when her vintage Gucci bag was stolen from her unlocked car while she was at a baseball game. She never learned from experience and just didn't see a correlation between leaving things unlocked and theft/break-ins.
My point is that some people will never learn their lesson, even when dangerous things have already happened. If your roommate cannot learn to lock the doors, you should not continue to give him a chance. If he won't lock the doors, you need to find a roommate who will. Safety is the most important thing.