Firstly, and sadly, I get a bit mentally stuck on X. Secondly I assume I have missed something. Whatever I have missed is probably quite important, since otherwise X was a good choice.
Both of these effects mean that I will probably learn a lot from knowing why someone decided not to do X. So, if I've been mulling the question for a while, and can't get an answer, I think it makes perfect sense to ask "why didn't you do X". After all, that is exactly what I am wondering in good faith.
It sucks that the question is often used sarcastically, because to me it's a very useful question for understanding someone else's process.
Often I've asked it because I privately thought "why didn't they use X?", but I'm seldom actually interested in hearing why they didn't.
Also, if you want to understand why someone did Y, ask deeper questions around why they did Y, don't ask why they didn't pick the other 500,000 possible solutions.