In my very first interview after graduating, I was asked this question. I lived in a remote part of Australia at the time and I said something like: "To move to Sydney or Melbourne and advance my career in those bigger and more dynamic markets." - two seconds after I said this I realised I had just filtered myself out of the second round short list. ie The role was meant to be quite permanent, and obviously my wanting to move two timezones away meant that I wasn't planning on staying with the company for the long haul.
Anecdotal story aside, I think they basically ask this to see what your ambitions are, and how they fit in with the profile of the role.
It doesn't always pay to sound very ambitious. When hiring junior or intermediate coders, companies often look for people who won't ask for too much money very soon, and who won't rock the boat too much or try to change things and advance out of the role within 6 months. Sometimes, sounding like you'd be happy to be a code monkey for a while can actually help get you in the door. The trick is to research the role and know what's expected, and then answer this question in a way that accommodates those expectations as well as possible (while being honest and true to yourself as much as possible, of course).
There is a balance of course, but the point is in matching yourself to what you think the role is about. This is essentially what that question is for. Seeing if your ambitions for the next "5 year plan" of your career are matched with what the role is about.
BTW, I've also taken to turning this around and asking THEM what projects and what kind of new or expended business the company is looking at doing in five years. This can give you a clearer picture of whether the role is worth pursuing. Not having a strong answer to this can often indicate that the work will mainly be a support and maintenance grind.