In the movie, Hagrid didn't have the spider in his dorm room. It must have just been an unused room.
okay, that'd be where the confusion was.