In other words, why doesn't British English generally pronounce the r
in such words?
This part is just wrong. First of all, there is not one "British English", spoken by all British people. Especially not in terms of pronunciation, which varies a lot between people with regional accents, those without and speakers of received pronunciation.
Also, it is not true to say that British people don't pronounce the letter r. There are regional accents that are rhotic and involve the r being pronounced strongly. Even in the non-rhotic accents, the r is still pronounced; just not strongly.
If it was not, that would change the pronunciation of words that contain it. Consider the examples given in the question: park, yard, cartoon, margarine. If these were pronounced without an r, they would be pak (the same as the word pack, as in pack a suitcase), yad (rhyming with the word bad), catoon (rhyming with the word cat), and magaine (with the "mag" part rhyming with the word badge and the second a pronounced as the a in the words cat and badge. The entire word would then be pronounced as maj-ah-een).
As a British person, I can tell you with certainty, that this is not the case. These words are definitely not pronounced like that. If anyone did so, they would immediately stand out as odd and different from the overwhelming majority of British people.
The main point here is that the letter r is still pronounced, just not always strongly. In non-rhotic speech, it is a soft and gentle sound. I can appreciate that this must difficult to notice and understand for people with strong, rhotic accents. Especially Americans, the overwhelming majority of whom have very strong, rhotic accents that involving pronouncing the letter r, harshly.