That's more than 14,000 days. How far did they travel? If you walked  at the rate of 1 mile per day, five days a week, you could travel from Canada to Uganda and back in 40 years, and still have time for the occasional vacation.  If you do the math in the 40-year time frame, the Israelites were camped  most of the time. Either that or they were going around in circles. Or looking for something that they couldn't find, or searching for the perfect spot to cross.....into the promised land? 

The easy answer is they were being punished for their lack of faith. Well that is the easy answer for this blog posting. (Side note:  I do not feel like I am being punished I just think this is a great example for thinking you are doing what is right and in hindsight realizing it wasn't)