I can't guess what is the main reason. There might not even be a main reason, as many groups of people at Apple and its shareholders decided this over the years.
(Also see my speculations below in this thread).
So not in any order of importance to Apple:
1) Create the same moat as NVIDIA has with CUDA.
2) Ability to re-define the microcode instruction set of all the dozens of different Apple Silicon chips now and in the future without having to worry about backwards compatibility. Each Apple Silicon chip simply recompiles code at runtime (similar to my adaptive compiler).
3) Zero hardware documentation needed, much cheaper PR and faster time to market, also making it harder to reverse engineer or repair.
4) Security. Security by obscurity
5) Keeping the walled garden up longer.
6) Frustrating reverse engineering of Apple software. You must realize Apple competes with their own third party developers. Apple can optimize code on the GPU and ANE, third party developers can not and are forbidden too by Apple.
7) Frustrating reverse engineering of Apple hardware.
8) It won't make Apple more sales if 3rd party developers can write faster and more energy efficient GPU and NPU software.
9) Legal and patent infringements considerations
10) Future compiler improvements
11 ) Trade secrets