It's often difficult to say "why" a sound change happened, so I'll focus on your other questions. Rhotacism in Latin happened via a series of sound changes. It only affected inherited *s in specific environments.
##The reconstructed steps of rhotacism, and their conditions
The first step towards rhotacism is believed to have been voicing of single "s" to the sound [z] in certain contexts: generally, between vowels. Phonologically, this change can be seen as an assimilation of the consonant to the surrounding voiced segments. This kind of voicing assimilation is common historically; for example, it also occured between Classical Latin and many Romance languages. Double ss remained unvoiced.
In some related languages, such as Oscan, /z/ remained as such between vowels and did not undergo rhotacism. We know this because we have Oscan inscriptions written in the Latin alphabet that use the letter Z for this sound (Buck 1904). (However, my understanding is that we don't have evidence of the letter Z being used this way in Latin inscriptions: see the related question Why are there no native Latin words with a Z?)
The next step of rhotacism (z > r) is a little less common across languages, but we do have some other examples. The process also applied historically in Germanic; one place where you can see the result in English is forlorn, which is historically related to the verb lose. Rhotacism is thought to have occured in Old Latin, and to have been complete by the 4th century BCE.
As a result of these changes, original intervocalic *s ultimately became r in Classical Latin. In the ancestor of Latin, *s seems to have also been voiced to [z] after the voiced resonant /r/, so another related sound change is original *rs to Classical Latin rr. One word that shows this change is terra "earth," from Proto-Indo-European *ters- (“dry”). The cluster rs that occurs in Classical Latin is a simplification of earlier *rtt or *rts; this is why most words with rs also have rt in some forms or in related words (such as ars "art," genitive artis). There also seems to have been voicing of *s after the voiced lateral resonant /l/, but the end outcome of that cluster in Classical Latin was geminate ll.
However, there also seem to be some words where *s developed into z and then r directly before a voiced consonant; in fact, the voicing in these words seems to have occurred earlier than the intervocalic voicing. For example, Proto-Indo-European -sg*- seems to be the ancestor of rg in mergo "to immerse, engulf" and probably in virga "twig, switch, rod" (de Melo). This also applied before the semivowel v [w]; thanks to TKR for pointing this out in a comment. A strange example that does seem to have undergone rhotacization between Old and Classical Latin is the word carmen, which Lewis and Short say used to be casmen.
##In Classical Latin, the distribution of r and s often didn't conform to the conditions of rhotacism, which indicates that it was no longer an active sound change by that time