It isn't illegal. I work in recruitment and we ask this sort of thing all the time.
Mostly, we like to know where else candidates are interviewing because it gives us a good picture of:
a) whether they might get an offer tomorrow, which would make things interesting for our recruitment process!
b) if they are primarily interested in the sort of work we do, or if ALL their other interviews are for ... nucleur physics labs. If so, why?
c) if it is a part-time job, whether their 'immediately avaialble and really flexible on days of the week' will suddenly become, 'only available tuesdays and thursdays until 4pm.
As employers it's our responsibility to our company, our employers and also to the eventual person we hire, to make SURE that we know what their expectations are, and that they can do what we need them to, without it creating huge issues for them. We're not trying to trip them up, but it's crap for everyone if they pull out at round 4, or 2 weeks into the job have to rearrange all their hours.