Why did men in Qing Dynasty braid their hair?

This question is a bit one-sided.

Men's hairstyles in Qing Dynasty conformed to Manchu customs, which showed that all ethnic groups obeyed Manchu after Manchu entered the Central Plains.

This hairstyle is not simply called "braiding", but shaving the front hair and braiding the back hair.

This is a common custom in East Asian countries. The Mongols shaved off some of their hair and kept some in Genghis Khan's time. Before the Meiji Restoration in Japan, men's hairstyles were almost exactly the same as Genghis Khan in history books, which can be seen from ukiyo-e paintings. This custom may have the same origin as the custom of chiseling front teeth in Nanyang Islands, and it is a rite of passage.