It's one of those things I picked up from when older people taught me how to drive. Presumably from when hand brakes were more likely to fail than on modern cars. Maybe if someone crashes into the car while it's parked.
Either way I still do it. And turn my wheels towards/away from the kerb on a hill as appropriate. Probably useless but if you have a fail-safe, may as well apply it.
Forgetting the handbrake is a common cause of minor accidents. Half the automotive 'fail' videos on the internet are people forgetting the handbrake. The habit of never leaving the engine on neutral greatly reduces the probability of this kind of an accident.
And sometimes even non-minor. Wasn't Anton Yelchin (the Star Trek actor) killed when he got out of his car to open his security gate and was crushed?