In my observations, it depends on the context of the situation.
Most of the time (in my opinion, from my experience), however, if they use the word 'would', they are likely upset, uncommonly perplexed, or emotional because you asked 'that' (especially if they say 'Why would you even ask that?' or if they put uncommon emphasis on 'Why', 'that', or 'would'). They may just be slightly emotional, or find it funny that you asked (pay attention to see if they're smiling or laughing). Maybe you asked something unusual that a native English speaker normally wouldn't say (which may or may not have anything to do with language, and everything to do with culture). Listen to their tone of voice, as it may convey more meaning than the words they say.
If they're calm and collected, however, they might just be more inquisitive and not at all offended, alienated, or tickled by what you said.
Arguably, they could mean the same things I highlighted above if they said 'did' instead of 'would' (especially if they add emphasis somewhere), but I think that's less common (although it still happens).
In another light, 'would' isn't limited to the past, and it's not limited to something that actually happened, while 'did' is. You could ask someone why they would do something they're hypothesizing about, but you can't sensibly ask someone why they did something they're hypothesizing about unless they've actually done it:
- Why would you build that time machine [you're thinking about building (which time machine you've never built to date)]?
- Why did you build a snowman [last winter]?
- Why would you say that [thing you're thinking about saying, but haven't actually said]?
If you actually did 'ask that' and they still say 'would', they might be thinking it's something you're likely to ask again, or be in a habit of asking (but they might not be thinking either of those things).
Arguably, the two phrases are interchangeable with pretty much the same meaning in some contexts:
- Why would you ask that [thing you asked in the past]?
- Why did you ask that [thing you asked in the past]?
Although the words 'would' and 'did' have different meanings, the sentences as a whole pretty much mean the same thing here in some contexts. Saying 'Why would you ask that' seems to me that it would solicit a variety of reasons, potentially, while 'Why did you ask that?' seems to me that it would only solicit one reason (the specific reason you had for asking). 'Why would you ask that?' seems more polite in my mind, because it allows people to answer truthfully without forcing them to say their true intent in that specific circumstance; however, if you know they really only want to know that reason, you probably shouldn't let them think that was it if it was just a reason you might have, but didn't use.