A second reason for doing this is to make theft of devices less lucrative. If you can't sell a stolen phone for parts, then there's less incentive to steal the phone.
I think there's more that Apple could do to make third party repairs easier without sacrificing security or theft disincentives. Maybe there could be a setting where I, as the owner, can authorize parts salvage of the phone before I sell it.
If security is your primary need, it is great.
If sustainability is your primary need then it sucks.
Another reason for locking parts to the phone is to prevent non-genuine parts. Those cheap batteries or TFT replacement screens for OLED iPhones will not give the experience Apple intended and will damage their reputation.