In A. Hitchcock's masterpiece film, Rear Window (1954), Thorwald enters the front door, because it was unlocked. Why would the protagonist keep his door unlocked?
I can think of many reasons:
Jeff keeps the door open throughout the movie because he broke his leg and he's immobile. That way visitors could enter easily.
He's probably doing this because there are also steps leading up to the door and he can't bolt it himself. (Even if there weren't any stairs, it's still hard to reach it when he's in a wheelchair and his leg is sticking out like that.)
Stella leaves the apartment right before Thorwald appears, which is why the door is unlocked in the first place.
Jeff didn't go to lock it when she left (or told her to) because the phone rang at that very moment and distracted him, and he had to answer it. He was also too worried about Lisa to think about it right then.
It's possible neither Stella nor Jeff thought Thorwald would be so brazen to actually come to Jeff, his own neighbor, and try to kill him after the police has been by.
This is a friendly neighborhood in the 50s, where the residents possibly kept their doors unlocked anyway.