As jknappen says, it came down to sound shifts in Latin.
A portion of the Latin case system (first and second declension singular) looked like this:
Nom -a -us
Gen -aj -i:
Dat -aj -o:
Acc -am -um
Abl -a: -o:
Voc -a -e
(Note that this is IPA phonemic transcription, not Latin orthography. Basically, Nom = subject, Gen = possessive, Dat = indirect object, Acc = direct object, Abl = object of a preposition, Voc = person being spoken to directly.)
In Classical times, final
/m/ started to disappear, nasalizing the previous vowel (like in French). Then in Later Latin, the fourteen Classical vowels simplified down into seven, and this nasalization vanished. Now we have:
Nom -a -o
Gen -e -i
Dat -e -o
Acc -a -o
Abl -a -o
Voc -a -e
At this point the case system is significantly less useful! In particular, the nominative and accusative look exactly the same, so word order started to take their place: the verb was placed in the middle, with the subject before it and the object after it.
Once the cases stopped being so useful, these last few vestiges faded away too: the prepositions ad "toward" and pro "for" took the place of the dative, de "down from" took the place of the genitive, and so on. And thus you end up with their descendants in modern (Tuscan) Italian:
Nom -a -o
All of this simplification happened before Late Latin/Romance split apart into what would become French, Spanish, Italian, and so on. That's why Romance languages for the most part have no cases on their nouns. But this process didn't affect personal pronouns, which were already fossilized in Classical Latin and used different inflection patterns, so those retained case.
EDIT: fdb has pointed out that Old French preserves a case distinction in third-declension nouns, a type that isn't covered here. He's completely right! My bad. So the complete loss of cases in general was after the Romance split.
EDIT 2: Romanian, Dalmation, and I think maybe Sardinian do preserve some of the cases. Mea culpa.