The $5,000 could have brought mortgage up to date.
First of all, there are not enough facts for a full answer. On the face of it, I would question the advice, but again there are not enough facts. If you feel that something was done wrong, or wonder if the advice was solid, just like a doctors diagnosis, have a second local probate attorney give you their opinion. A little money spend on a second opinion is well worth the piece of mind.
Just because it was foreclosed, does not mean paying the IRS was a bad decision, they are generally good at getting their money one way or another.
This answer is a free service to you, and the general public based on limited facts specific only to your issue, and may not apply in every situation. To assure that your situation does not differ from the answer provided above, you should immediately consult a licensed attorney in your state with all the relevant facts and details regarding your specific concerns. Please note, this forum is not a place to communicate all the details, as this forum is public and it could limit your rights in the future. This is not an opinion under the Government Regulations contained in IRS Circular 230, which regulate written opinions about Federal tax matters. This is not such a written opinion, it is an other written communication, and was not written to be relied upon, by itself, to avoid any tax penalties. In order to receive assurances of protection from tax penalties from a written communication, you should get an opinion letter. If you would like to discuss an opinion letter relating to any matter, please contact me and I will explain what is involved and what it will cost.