At the end of the day, quality posts can be made, and then deleted after. I say automatically removing the merit once its been deleted isn't exactly the best approach. What I would say is, if the post is deleted directly by a moderator or whatever then it should be removed. However, if you made a reply in a thread which was removed it shouldn't. So, only if directly removed should merit be removed too. Self moderated threads shouldn't count.
I'll use an example which I've used before: I merited a scam-warning (because it's worth reading), until the OP got nuked and the scam warning got deleted too. That post deserved it at that time, and a Mod removed the entire thread. I don't think that Merit should be removed.
However, if I look at
my full Merit history, I see about a dozen of deleted posts merited by me, and a few of my merited posts got deleted too. (note: if a post got deleted after I scraped the title, I don't change the label into "deleted" anymore)
Considering this is at most 1-2% of all Merit, I'd say it's totally acceptable to remove all Merit from all deleted posts. For legit users, it will just be like the very small change that happens to your Post Count once in a while.
For abusers on the other hand, the majority or all their Merit can disappear if it's removed once a post gets deleted! This will be well worth the small inconvenience of legit users losing a small fraction of their Merit.
This brings me to the conclusion: I'm in favor of removing Merit once a post gets deleted. This should not be limited to posts deleted by Moderators, since many Merit abusers hide the evidence by deleting their own post.