It spins, so therefore it MUST have at least one axis about which the motion occurs. As to why it spins, this is a question that goes all the way back to when the planet was formed, and we have very little information about this time. Since the original cloud out of which the solar system formed had 'angular momentum' it figures that all of its components must have obtained and locked away a bit of this original motion.