BMW does for several reasons, but the biggest one is liability. Imagine someone buys a BMW from a sleazy shop that improperly rebuilt a salvaged car. That customer goes to BMW for some unrelated repair/service and a week later they get seriously injured (or killed) in an accident where the cause was the fact the car was improperly repaired.
Who do you think the lawyers are going to go after? The shop that rebuilt the car or BMW? It's always those with the deepest pockets that get sued. The logic behind these types of claims (which I've seen lots of) is that the BMW dealer, being experts in BMW's, should have noticed issues with the car, and were negligent in letting the vehicle leave the shop. This is compounded by the fact that BMW would have the VIN flagged and the dealer would know it was written off. Therefore, they should have taken extra care when working on the vehicle to make sure it was safe to drive.
There was even a shop here where a customer brought in a vehicle for inspection which was clearly unsafe to drive. They told the customer it's not safe to drive and had them sign a waiver before they left the shop (they actually told the customer they should tow it away, but they refused). They got into an accident and guess who got sued? The shop for letting the vehicle leave in an unsafe state.
Another example of liability is Mercedes and training vehicles. They literally destroy them after use (most manufacturers sell them as demos or similar). I once investigated a fire in a brand new Mercedes where a battery cable had melted and caused some minor damage (perhaps $3,000). Mercedes gave the customer a new car and crushed the old one. I couldn't believe they'd crush a car with such minor damage. I asked them if any staff (like a Mercedes technician) could buy these cars for their own use. They stated nobody can buy them and they crush them to prevent them from ever getting into the hands of those sleazy shops who will repair anything to make a quick buck.
I have seen a lot of cases where shops would refuse to take a customers money. Moreso with the higher-end vehicles. I've also seen a lot of cases where they don't give a damn and will work on anything, just to make money.
This gets back to my previous post. Apple is acting like Mercedes here by preventing a severely damaged iMac Pro from being repaired and getting back into the market. Because if something goes wrong, you know who will get the blame.