I'm going to answer the basic reasons. People might have their own reasons based on how they think or play, but these are the standard ones.
Substitute eases prediction. This means that predicting wrong with substitute doesn't amount to much, and predicting right can put you at an advantage. If you had say, terrakion with substitute against garchomp. Garchomp might expect you to switch or it will set up rocks. if either of those happens you can just set up and attack. However, what if the Garchomp just used Earthquake? Well, you put your sub up, so you don't get KO'd. If you didn't have sub however, you would have just been knocked out. So why not use Protect? Well, if you can get your sub up and have it not blown down again, it puts you at a significant advantage, giving you extra turns to set up, attack right off the bat or avoid status. But if you used protect then there's no benefit if nothing went wrong. Protect only helps you in one scenario, not both like Sub does.
The other is to simply avoid status moves. It'a annoying to get paralysed or will-o-wipsed by a wall you can't break through. So just set up a sub and swords dance 50 times first. They can't do anything except switch out or hope for crits.