It rotates because it always has, basically. Everywhere you go in space there is turbulence - things spinning around each other and around their own axes. A non-spinning object would be a novelty.
If you add up all the angular momentum (involving spin rate, mass and radius of rotation) in a system, it stays the same. A vast Nebula which is hardly spinning at all will develop, as it collapses in on itself through gravitational attraction, into a Solar System with spinning Star and orbiting stuff where the rotations are much faster - this is because the radius of rotation has got so much less that the spin speed has to increase to conserve angular momentum. (Ice skaters etc. used this too).
btw the conservation of angular momentum means that, if all the planets in our Solar System were hauled in towards the Sun, the Sun would be spinning so fast that it would fly apart again - flinging a lot of orbiting debris out until it was spinning at a manageable rate again. Amazing when you think that there's less than 1% of the Sun's mass orbiting around it and it could make all that difference.
So all stars can be expected to have spinning stuff orbiting round them - just to keep things stable.