The pictures you posted are of the top GMs in the world (Anand, Carlsen, Aronian, Caruana). These GMs almost exclusively play in elite invitational tournaments, normally with around 8-10ish players. As a result, these tournaments likely have a strict dress code because the organizers want to maintain the high prestige of the event.
For example, the Bilbao tournament is a double round robin with 4-6 of the top players in the world. It's regarded as a very strong tournament, solely based off these 4-6 players. So, imagine if the players showed up wearing casual clothes, like shorts and t-shirts. The players may be regarded by fans as "less professional", which will severely damage the reputation of the tournament.
Another reason top GMs dress in suits is that they are being endorsed, or want to be endorsed (look at Carlsen's shirt in the photo you posted -- he's advertising for Arctic Securities). If a company was looking for a chess player to advertise their brand, they'll prefer the player that looks better/more professional.
Conversely, most average GMs in open tournaments do not dress in suits. This is due to the 2 reasons mentioned above, except flipped. The prestige of open tournaments do not depend on how a select few players dress, since open tournaments have hundreds of players. Also, average GMs are not going to be endorsed by big companies, so they have no incentive to dress up (unless they want to).