It's not just the 12 kids. With the money spent Thailand is paying for a belief in the minds of its people: that the government would do the same for their kid.
I'd argue that this kind of belief is extremely valuable for a country's economics as a whole. In order for the populace to be economically productive (and save 50000 kids from dying of diarrheal diseas) you need to create a safe, reliable, and predictable environment. Governments insuring against events like kids getting lost in caves is the way that they get that.
We still can spend money and save 50000 kids, it is not an A OR B problem.
There is plenty of money and resources out there to save all kids dying from easily preventable diarrheal diseases. There is no political will to do that.
Your comment is fading, and I upvoted even though I don't really agree with your premise.
I do have a respectful question though - are you, personally, acting to save those 50,000 kids? Is there an effective organization out there that accepts donations for this kind of thing, and if so, are you giving to them?