I am developing some custom tools that revolves around building UI from the hierarchy structure. For many of my components I generate the children procedurally, meaning that it would be undesirable to already have children before I generate. The transform child flags could be an enum flag that revolved around these 3 options: None, DisallowChildren and DisallowParent.
When dragging an object in the hierarchy, all of the transforms with child flags set to DisallowChildren could turn gray or red and become non-interactable. This makes it clear that you can not set these transforms as the parent and would also directly prohibit you from doing so. Releasing the mouse while over one of these transforms would cancel the parenting operation and turn them back to normal color.
This can be applied to a lot of things. For example rigged bones. You do not want the user to move them under another transform. Neither do you want the user to add random objects inside the bone structure. The child flags would only affect the hierarchy and could be overwritten by calling SetParent() in a script.