It would be naive to think theft didn't happen on the Camino, but I think overall, it's a rather rare occasion, compared to other places with so many people around. I remember in the Tosantos albergue, someone had left a considerable amount of money on their bed/sleeping bag while being away. Nothing happened. Several times, people thought something might have been stolen, only to find it somewhere down in their backpack or under their bed later...
I think one lesson to learn is, as others said already, don't carry anything you can't afford to lose - apart from passport ect, of course. I managed to lose a hiking boot, of all things (not stolen, really lost it, haha!), but well, I had another pair of shoes in my backpack to replace it... if not, would have bought a new pair. That's life, things come and go, as do people. The Camino can teach you a lot about not getting too attached to anything.
Doesn't mean you should be reckless, though. When I stayed in the Sarria municipal albergue, apparently someone tried to steal my handbag (with money, passport, phone ect)
while I was standing right beside! I do not carry much money and the phone was old, but still would have been a problem. I had put the bag onto my bed, while I was putting the sheets on. So, the bag was
right next to me on the rear end of the bed, and I only turned towards the pillow... when I turned to the other side again, a guy I didn't know had my bag in his hand. He put it back on the bed immediately, claiming he only wanted to help me put the sheets on.... sure, you need my handbag for that, thanks
That person also later mocked me when I politely asked them not to party in the dormitory while others tried to sleep. Lovely!
But I prefer to think of the good people - the girl who gave me a spare towel after I lost mine, the angel who carried something I forgot in Leon all the way to Finisterre to give it back to me, the people offering medicine and sweets and oranges when I got sick; the young man who carried an elderly man's backpack when that man had fallen and had trouble walking, the person who found someone's lost phone and carried it until they found the owner, ect ect. Not to speak about all the great hospitaleros and hospitaleras...
Focus on the good things. The Camino is well known for those, and much less for crime