Nothing keeps the sun spinning. The sun spins under its own inertia and does not need any help to keep it going. Isaac Newton observed that objects in motion tend to stay in motion. This is called the Law of Inertia. It means that if an object is already moving and nothing acts on it to stop it, the object will just keep moving under its own inertia. For instance, a hockey puck sliding across the parking lot will only stop if it hits a wall or if there is enough friction acting on it to slow it down to a stop. Without an external force like friction or a wall getting in the way, the puck will slide forever under its own inertia. The Law of Inertia is just a conceptual statement. The more general and more mathematical version of the Law of Inertia is called the Law of Conservation of Momentum. It states that the total momentum of an object stays constant if nothing acts on the object.
There are two basic types of motion: moving forward in a straight line (linear motion) and turning around in a circle (rotational motion). For both types of motion, the momentum of an undisturbed object is conserved. In other words, an object that is moving forward in a straight line will continue moving forward in a straight line if left alone, and an object that is spinning will continue to spin if left alone. For instance, if you get a child's top spinning, it just keeps on spinning. Eventually it stops because of the little bit of friction acting on its base. But if there were no friction, it would just keep spinning forever. The Law of Conservation of Momentum applies to both linear and rotational motion. For rotational motion, the law is called the Law of Conservation of Angular Momentum. This law is why the sun keeps spinning. Since there is effectively zero friction in space and because there is nothing grabbing the sun, there is nothing stopping the sun. Therefore, it just keeps on spinning under its own angular momentum. This effect is not some special property of the sun. All planets, moons, and stars spin for this same reason.
These concepts naturally lead to the next question: What got the sun spinning in the first place? The answer to this question is a bit more complicated, but it again comes down to the Law of Conservation of Angular Momentum. This law states more than the fact that a spinning object keeps spinning. It also states that the total angular momentum of an object remains constant, even if the object changes shape, as long as the object is isolated from external influences. The angular momentum of an object equals its angular speed of rotation times its moment of inertia. The moment of inertia specifies how far away the different mass-carrying parts of the object are away from the axis of rotation. In order to keep the angular momentum constant, if the object's moment of inertia goes down (i.e. it gets more compacted), its speed of rotation must go up.
You have probably seen this effect before. Consider an ice skater that is spinning quickly in one place. When the ice skater brings in her arms, her spinning speeds up. When she extends her arms, her spinning slows down. All of this happens because her total angular momentum must stay constant. You can even experience this effect yourself. Sit on a swivel chair, lift your feet off the ground and get yourself spinning. You can control how fast you spin by how far you extend your arms and legs. Another example of this effect is water going down the drain. Due to tiny natural vibrations in the house, a tub of water gets a very small amount of spinning motion. This amount of spinning is usually so small that you can't notice it. But as the water heads towards the drain, it compacts into a smaller distribution of water. In order to keep its angular momentum constant, the water must speed up its rotation. As a result, the water swirls quickly down the drain. (Contrary to popular belief, the swirling motion of water going down a drain is not caused by the Coriolis force.)
Now let's return to the sun. The sun, and in fact the whole solar system, formed from a giant cloud of gas and dust. Because of random gravitational interactions with other astronomical bodies, this cloud gained a very small amount of rotational motion. Based on statistics, it would be nearly impossible for any cloud of fluid material to have exactly zero rotational motion. Over time, this cloud of gas and dust collapsed down under the influence of gravity. It collapsed down to form the sun and the planets in our solar system. Just like with water going down the drain, conservation of angular momentum made it so that a large cloud with a little bit of spinning motion compacted into a relatively small sun and planets with a lot of spinning motion. Since the planets and the sun all formed from the same cloud, the planets all orbit the sun in the same direction that the sun spins.
In summary, the sun keeps spinning because there is nothing to stop it. The sun started spinning because it formed from a large cloud with a little bit of spinning motion that got compacted down.