Everything else the same I would prefer my classmate as my roommate. A few points in consideration:
1. If your classmate is your roommate you can have another person in your house to discuss your courses, clubs, activities - it is kinda difficult to keep track of all that is going on in the school with all the course load and assignments etc. If you tie up with some other student you may not have similar things going on to discuss such as job search, networking events etc. I am not saying that you will have no contact with other classmates outside your house but it helps to have your classmate as your roommate.
2. I have seen some of my classmates who boarded with non-classmates looking for a new roommate after a short while (not a very good planning, may be) since their current roommate had graduated or was going for study abroad. So timing wise you are more likely to not have to find a new person to stay with you if you are enrolled in the same program as your roommate.
Ultimately, I think it boils down to if you are comfortable with your roommate. If not courses may be other interests would match if your roommate is not your classmate, but it is difficult to find that out upfront.