This started in another discussion where this was introduced as a side issue, and I provided the following answer. Others might prefer to discuss this. My previous answer was:
First, why is rotation usually prograde? In my ebook "Planetary Formation and Biogenesis" I outline a mechanism that involves essentially monarchic growth for the giants, and probably for other planets. The mechanism avoids the plethora of planetesimals because over 80 years nobody has a clue how they could form - I proposed that the initiation is chemical, and bodies have special zones that favour very rapid growth. In the absence of major collisions, what happens is the biggest body moves towards Keplerian velocity, which is faster than the gas stream. That leads to a greater pressure on the leading face, and as the gas is also falling starwards it applies a torque to the leading face that provides prograde spin. (What happens next also gives the body an increase in angular momentum, and hence lift.)
Uranus and Neptune are problems because they effectively state on their side and somewhat retrograde. Pluto's rotation is almost certainly affected by whatever formed its moon system - presumably a collision - and I assume something like that must have happened for the Ice Giants. The planets Mercury and Venus originated in zones where there would be more rocky bodies formed, and thy would be bombarded randomly so there would be little rotation. Mercury seems to have got itself into some sort of resonance with the sun. Venus has a retrograde rotation, and the most interesting explanation I have seen for that is that thermal tides in the atmosphere lead to that in planets inside the so-called habitable zone. What happens is the hottest part of the atmosphere is about 3 pm, and that leads to atmospheric currents that apply the retrograde torque. Venus is actually limited here because it has so much atmosphere and therefore so much thermal inertia. If it had a bit less it would rotate faster retrogradely - if that theory is correct.