Disclaimer: I'm not quoting historical facts below.
The issue, as I see it, is this: if one postulates the existence of a translation invariant measure on $\mathbb R$, one can show that such a measure cannot exist. Now, the intuitive notion of length in $\mathbb R$ can be used to define something akin to a measure, by approximating the size of a set with the sum of the sizes of intervals that contain it: this is what we call "Lebesgue's outer measure".
But, as mentioned above, one can show that such outer measure cannot be a measure over every subset of $\mathbb R$. So Caratheodory's idea (I'm not completely sure if I'm assigning priority correctly here) was to consider a certain family of subsets of $\mathbb R$ where he was able to show that Lesbesgue's outer measure is actually a measure; the properties of $\sigma$-algebra play a key role in his proof. This family is what we call the $\sigma$-algebra of Lebesgue-measurable sets. I guess eventually it was realized that the notion of $\sigma$-algebra was the right environment where to define a measure.