I heard that lots of people get robbed on the Inca Trail.
I haven’t heard of anyone getting robbed on the Inca Trail. The only way you can do it is as part of a guided party where you are very unlikely indeed to be robbed.
I don’t think you can camp except as part of a guided trek near MP so I’d recommend Ollayantaytambo as a stop off, there are quite a few cheap hostels, B&B’s and a hotel. There is a train which leaves from there to MP and an interesting Inca fortress to look around as well.
I’d go there look around the fortress and spend the night to leave on the first train in the morning to MP its self. At night there are hundreds of taxis which can take you back to Cusco which are much much cheaper than the train ( and you can get there on buses from Cusco too for next to nothing ).
I’d say that the area around MP is very very safe indeed, all the locals are really pleasant and friendly and you’re never more than 10 yards away from other tourists.
Ok, do whatever, but be careful. You should know that tours can and do get robbed. If you are walking the Inca trail (no matter if you have a guide with you or not), put your valuables in one of those money sack things, but leave a couple of bills out that you can hand over. Being with a tour doesn’t guarantee safety by any means. Tour guides aren’t security guards, and they occasionally get paid off by criminals to lead people into harm’s way. I don’t want to scare you, I just don’t want you to be foolish. By all means, go. Just use common sense.
I think being robed on the Inca Trail used to happen in the past but happens much more seldom nowadays as it is now heavily regulated to avoid the trail being damaged. As a result, every guide and porter is officially registered and would lose their job if a theft was reported. It still means that you should pay attention to your valuables but in practice you are more likely to get robbed in Cusco than on the Trail itself.
At the end of day, you have the same dangers in Peru than you have in any other place on Earth where the local population earns a fraction of what you earn so you need to be streetwise and not flaunt your expensive stuff. A little care goes a long way. I spent 5 weeks in Peru carying expensive camera gear all around the place and never had a single problem, be it on the Trail or anywhere else.