Since 1990s Apple did provide free mac-s + software to schools and managed to hook several generations on their stuff.
As the cost of the computer system is not relevant to well paid engineers they simply refuse to consider using pc-s and other operating systems.
Regarding linux compatibility - it is mostly true on user level only.
Try for example to deal with a usb device on mac os and you will find it is very different than the way in Linux.
Probably the biggest problem with Apple stuff is their tight control over the platform.
Every few months users are prompted to update the operating system.
Things which did previously work, like for ex. booting Linux or Windows may not work anymore…