Yes, it should. As long as the question is closed, if its author is gone, there's little chance anyone else would be able to improve the question. Closing means that we expect the author to provide more information or clarification, and if they are gone who is going to make the question answerable?
In this case, the question wasn't good. Its author decided to delete their account for some reason. The answer was ok, but it's nothing special that we need to preserve. I am pretty sure there are similar answers available on the site already. We haven't lost anything. You, as an answerer, might have lost a few minutes of your time, but it's only a lesson for the future to be pickier with the questions you answer.
However, if the question was wrongly closed or if it can be edited and reopened, you can flag for the moderator's attention and ask to undelete. But the question would have to be reopened first and be in a good overall state for a mod to consider undeleting it.