Dressing to fit in with the locals is more than just about style—it's about safety too. When you look like you're "not from around here," you stick out like a sore thumb to thieves, scammers and worse. The less touristy you look, the less attention you'll draw from the wrong kind of people.
In conservative countries, it's even more important to follow the local dress codes. Some places have clothing laws that are strictly enforced by the authorities. It's always best to look into dress code guidelines for whatever country you'll be visiting well ahead of your journey.