We believe it is to cater for users who don't set up an iCloud Family Sharing unit with their kids, but instead give them their own iPhone with their own iCloud account. Short of separately being able to register a parent on TouchID or FaceID, a secondary code is needed, as the child would have full access to their own iCloud settings.
It's also helpful to use a passcode rather than an iCloud account where these restrictions are applied en masse via MDM across many devices where there isn't a parent as such, such as on a school or company's devices. It's not just for restricting access for children using the device.
When the family are tied together in an iCloud Family share it would be possible. However, users would always need the option of some sort of passcode override for times when it matters: like being on a long journey with the family where there's no Internet. Most of the world doesn't have Wi-Fi during flights, for instance, so without a code it wouldn't be possible to change Family Sharing settings.