Of course it does not make sense to lock an open door, but the door sensor can be wrong, not working or not responsive which also needs to be considered.
The current behavior was the outcome of a lengthy beta phase some time ago: Smart Lock 2.0 Door Sensor in 2.7.x Beta