Nothing at all unethical as you describe it.
Your buyer made an offer, contingent on the well being brought up to code. The sellers rejected that contingency. That's totally within their right to do so.
You may be implying that the listing agent knew of a material defect. If so, yes, that should have been disclosed. But, come on. As the other Don notes, all sales are as-is sales. Your buyers were smart to have the inspections. (Though a home inspection is usually around $400. Sounds as if they had more done than that.) And by spending that amount of money, they avoided making a purchase that could have cost them tens of thousands of dollars in unexpected repairs.
But that's really why you have the home inspection. To find out what the problems are. As you know, after some home inspections, people simply terminate the contract. Your buyers went further and asked that a problem be corrected. That's fine. But it's equally acceptable for the sellers to say "no." (It may well have been a mistake on their parts. Look: They probably didn't have the money to do the repairs. Who knows?)
So you tell your buyers: "I know you feel like you wasted your money, but you didn't. That $1,208 probably saved you $10,000 or more. And it's a perfect demonstration of why I recommend--and you should always have--a home inspection. Now, let's take a look at what's available so that we can find you a home."