Sometimes employers ask this question because they know that their pay will be low and want to only move forward with candidates who will consider the lower pay. For example, I work at a college in an area with a very low COL. The pay for most positions here is 1/2 of what it is at most colleges, and the pay for the position at most colleges is substantially less than the pay for the same position at most other types of businesses. So, for example, if someone is applying for a position that in the general American market would pay $100,000, but based on our region and the fact that we're a college we're only going to pay $40,000, we might as well found out at the start that they're not willing to work for less than $80,000, instead of flying them in for a 3-day interview process, then offering them $40,000 and having them walk out insulted. So, you may have run into a situation like that.
However, I still avoid that question like the plague. I have never had a specific required salary, so I always answer evasively, something along the lines of “I'm sure we can work out compensation”, and if they push further, ask them what their range in for the position. I have never yet had to be the one to name a requirement first. I have seen people have to name their requirements first, but only when they've brought it up. (Ex: when I've been part of the interview process, we've generally not discussed salary at a first interview, and saved it to discuss with a top candidate or candidates only. So, if in a first interview a candidate brings it up, our response is usually “What would you require?” then “Yes, we can meet that” or “this probably won't be the right fit for you” depending on their response.) If they're the one bringing up salary, make them name a figure first. You have nothing to gain by naming a requirement – name something low and you tell them they can rip you off; name something high and they will do as they've done here and decide not to interview you.
Sometimes the screeners or interviewers are persistent and you're stuck naming a figure, but most of the time (and thankfully so far in my experience) you can side-step it with a “I'm sure we can work something out; I'm sure you'll be fair; I'll be considering total compensation, so I'm sure we'll line up”; etc.
Sorry to hear you lost out on the interview…but hopefully it's a case where they were going to low-ball you to the point that you wouldn't be interested anyway. 🙂