There are huge, important segments of the macOS user base that require the ability to compile and run their own applications, locally. macOS has pretty much taken over all of academic science & education, & personal workstations for government research. It is the default platform for developers of all kinds in Silicon Valley. As Steve Balmer once argued, it's developers that matter to the long-term health of a platform. Apple deftly captured that market by providing a beautiful and easy to use UNIX-like environment with high quality hardware and good design. If Apple locked down macOS the same way they lock down iOS, it would be the largest foot-gun in the history of computing.
Simultaneously, while the user interface of macOS has converged on iOS over the last half dozen releases and the ecosystems are more tightly integrated, not a single one of these changes has gotten in the way of developers running their own code. The situation now is no different than it was in 2006, for example. What has been made more difficult is running untrusted binaries downloaded from the internet. That's not the same thing.
Simultaneously, while the user interface of macOS has converged on iOS over the last half dozen releases and the ecosystems are more tightly integrated, not a single one of these changes has gotten in the way of developers running their own code. The situation now is no different than it was in 2006, for example. What has been made more difficult is running untrusted binaries downloaded from the internet. That's not the same thing.