As for why a few parts remain open, it's probably just inertia. When OS X was new the open source/free software movement was at the peak of its hype cycle, many treated it as a locked in future, sort of how people talk about AI today. Kernel engineers in general were always pretty pro-open source, much moreso than GUI layer developers, and Linux was already available and growing fast. People believed that desktop Linux could be a competitive platform back then.
So as XNU was built on open source components like FreeBSD and Mach, I guess there was some internal fights between pro- and anti- open source camps. Jobs or someone else resolved it by saying it was OK to open source the low value / generic parts like the UNIX parts, but not the higher value userspace where macOS historically had competitive advantage. Then as the years passed this became just the way things are done, and nobody revisited it.
Also the Stepstone GCC based implementation of Objective-C frontend and language runtime were only begrudgingly contributed back to the project.
From what I remember, the original idea was to keep it open source so the community would take part in the review of UNIX-compliance, as an external party to ensure that Apple doesn't accidentally drift away too much.
But yeah, since it barely has any use outside of Apple products, I doubt that there is much power in the community to actually influence it...