The 'why' in the question implies that one knew X was a possible solution, or that you should know that X is a possible solution. An alternate to the question might be 'have you tried to do X?'.
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.
I very often find that my mind jumps to X as a solution. Then when X wasn't picked two things happen.
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.
Asking why they used what they did has always ended up in good explanations and less than expected defense of the tool/tech itself. Often it's just because it does the job and whoever used it knew it.
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.