I had the same question, and asked a (woman) counselor at my college, and was told it was what a lot of girls were told to say, for several reasons. First, it is a way to (supposedly) let you down easily, without your feelings getting hurt (as much). There are other similar strategies, such as saying they don't havbe time while they are going to school, etc. The second reason is that if the girl just says she's not interested, you are likely to ply her with questions about why not, and what you could do to change her mind. By her saying she has a boyfriend, it effectively closes the topic.
_________________
I was always told that there is safety in numbers, so I majored in math.
"Lunch...is on Millie" - Ace Rimmer