Apple almost went out of business allowing macOS to run on non-Apple hardware. I think there are still people there who have an irrational fear from that time.
From a current financial/business standpoint, Apple considers itself a hardware company that includes their custom OS with their hardware. From that angle it makes no sense to allow it to run on non-Apple hardware. Sort of like Sony being ok with the PS OS running on Xbox.
But it also makes no sense to forbid it. If Apple were a hardware company, letting people use their software on other devices wouldn't cut their baseline. After all, people buy Apple because of the hardware, right?
Apparently not, and because they subsidise the software using hardware sales, they don't want to decouple the two.
The Sony/PS situation is exactly the opposite: Sony subsidizes hardware using software (games) sales. Which is why they don't allow you to use different software on a PS.
Now that Apple leans into services revenue it might make sense to license the OS for clones, if they could still sell you an Apple Music subscription on your Samsung iOS device. But as matwood said above in the 90s they traded high-end hardware sales for much less lucrative license fees and lost badly. It was one of the very first things Jobs tried to fix when he returned, and he ended the program because he couldn't get terms he liked from the licensees. (Which in retrospect is weird because it put them entirely out of business, but shrug.)
From a current financial/business standpoint, Apple considers itself a hardware company that includes their custom OS with their hardware. From that angle it makes no sense to allow it to run on non-Apple hardware. Sort of like Sony being ok with the PS OS running on Xbox.