Why did Sherlock change clothes before seeing Irene Adler in the episode "A Scandal in Belgravia" (S02E01)? Same with the punch he asked John to do. Was that his attempt at impressing a girl because he doesn't understand them?
It was a disguise, a ruse, to get into Irene's house to obtain the phone.
In several iterations of Sherlock, he is known for taking on disguises to get into different locations to gather different information. For example, in one episode he dresses up as a security guard to get into a museum.
In this instance Sherlock made himself up to be a preacher that had been attacked in order to gain access to Irene's house. If he had just shown up as himself he more than likely (at least in most normal circumstances) would have been turned away. Instead, it was a fabricated "emergency" situation, intended to generate sympathy to allow him access.
John punching him was to add some authenticity to the story that he was mugged.
The disguise had nothing to do with Irene's gender, at the time Sherlock only knew about her either what he was told or what was on her website. For him that's a decent amount, but not enough for him to want to impress her at this point.