I'm not a lawyer, so this isn't legal advice. However, let's at least try to sort out a couple of different items.
From your posting, it appears that you were the tenant-buyer in a lease option. You paid over $5,000 in option fees. (Might have been up-front money, or rent credits, or both.)
The seller did not get a termite inspection and did not make repairs. You, the buyer, did not complete the purchase because the seller didn't get the inspection or make repairs.
Is that what you're trying to say?
OK. First, what does your option agreement provide. You probably have two documents from the owner--a lease and an option document. What does the option document say? Does it require the owner to make repairs prior to sale? (Probably not, but it could.) Often, in a lease-option transaction, you're essentially buying the property "as is." After all, you've been living there and you know what it's like. You've had a chance to "test drive" the property.
Most lease-options (nearly all) specify a date by which the option must be exercised. Some provide for an extension. It appears that you decided to exercise the option, but your lender required certain things to be done. And the property owner said "no." Check with a lawyer, but in many cases the owner can say "no." Just as if you wanted to buy any house. What the owner did agree to do, I assume, is sell you the property for a certain amount of money. Where you came up with the money, and any terms or conditions attached to the money, aren't really a concern of the seller. Again, though, it all comes back to the written documents you have from the seller.
If that's the situation, then (again, not legal advice) you're in a weak situation. The owner is willing to sell to you for a specific amount of money. It's up to you to produce that money. If the person loaning you the money imposes certain conditions (whether those conditions are a termite inspection....or that the house be painted blue), then--because you're the person borrowing the money--you're the person who has to satisfy those conditions.
As for the $5,000, again read your option documents. It probably says multiple times in there that the option fee is non-refundable. It probably says that the option fee will be credited toward the purchase price (or down payment) if the option is exercised. Otherwise, the option fee is forfeited.
If that's the case, then (again, not legal advice) you're probably out of luck. Sometimes an optionor will refund some of the option money, even though it's not required. But that's at the discretion of the seller. If the documents you signed say the money's not refundable, then it's not refundable.
One other thought: Sometimes, depending on how lease-options are structured, the seller makes most of his/her money when the property sells. If that's the case and the seller's "payday" comes with the sale, then try negotiating with the seller. (Or have your lawyer do so.) Maybe split the costs of the termite inspection and other repairs. After all, if you already have a loan commitment and you'd like to live in the house, and you already have $5,000 invested in the house, then it would make sense to try to work things out with the owner. And, from the owner's perspective, this is a soft real estate market...he has a ready and qualified buyer. I can't imagine he'd be happy losing the sale.
Hope that helps.