As a former Search/Rescue medic:

A) Legend has it that the last bow-tie-wearing nerd to question this policy slipped and fell overboard, or was maybe left for dead in the parking lot of some fisherman's dive bar in a quaint New England town. Nobody really knows for sure, because HIPAA, I think.

B) nobody in any decision-making-slash-accountability chain dares approach it that way, not only because they don't want to be knifed to death behind an AutoZone, but precedent goes back to, I dunno exactly, but I'll be bold and say "the dawn of seafaring", or maybe "whenever international maritime law was written down". (It ends up finding its way into "render assistance" clauses in some motor vehicle codes, by way of Rich People Horseless Carriage Sunday Driving Clubs and their Gentlemanly Codes of Honour or whatever - notably, predating Good Samaritan, IIRC.)

C) Most "diverted" resources probably aren't really doing anything of importance anyway, and people dying takes precedence over, say, taking pictures of the water or how sparkly the ozone layer is. Also, there's a good chance it's <training>.

There's usually a high degree of parallelism during the Search phase, as only the irrelevant half of the math works out on the fuel/time efficiency of, say, 1 aircraft vs 100 to fly a grid when the guy is (e.g.) clinging to a liferaft rope with broken arms, legs, back, and pelvis in 5' seas. The other 98 can go home (or the circles they were flying before) when Search is solved for and Rescue begins.

D) it's free training, almost certainly more interesting-slash-valuable than whatever was planned, and much higher fidelity than any simulation - PLUS! all of the inadequate planning, mixed messaging, nose-picking, dick-measuring, wrong radio channel-ing, confusion, ignorance, broken equipment, and general chaos of dealing with actual people in real life! ("practice how you perform/you perform how you practice")

As the OP demonstrates, there's often only a moment or two between your shitbox (built by the lowest bidder) catching on fire, and the need to flawlessly execute and context-switch through multiple checklists, with only your non-dominant hand, flight gloves, and your backup pocket knife, else everything explodes and everybody dies, The End.

The Navy sends ships out to sea during hurricanes, both because it's safer than smashing against docks, and “A smooth sea never made a skilled sailor". Also, there are some interesting anecdotes about building lazy or incorrect muscle memory, or people panicking and reverting to classroom-style behavior (like cleaning up and organizing tools) when they feel they've reached The End of their Scenario, as it were. Contrary to popular myth, most people get dumber and forget the most basic of things under pressure, rather than Rising To The Occasion and, classically, lifting a car off of a baby.

So, I suppose all of this is to say that one should probably also amortize the (extraordinary) cost of things like this over the value of things like "a competent Navy", "proficient aeromedical crews", "Marines that can count AND do things with their hands", "being able to insert a trauma surgeon (or explosives) basically anywhere in the world inside of a few hours", and so on.

As an old partner of mine would sing while chugging preworkout, checking equipment, and getting psyched for the day:

You only get one shot, do not miss your chance to blow //
This opportunity comes once in a lifetime //
You better

(Or, if you prefer the Latin: Haec Facimus, Ut Alii Vivant, Ut Ceteri Vivant, Etc.)