Why did the Leaf Village invite the Village Hidden by Sound for the Chunin exams?
At the time of the chunin exams, Konoha was unaware the Sound Village was built by Orochimaru. While Kabuto was infiltrating the exams as a Konoha genin, he mentioned the village was quite young and little was known about it. 


  
  Naruto Chapter 39


As for why the sound genin were in Konoha, the chunin exams became open to all villages as a result of the Third Shinobi War. Given how the Sound Village was unknown to be Orochimaru‘s cover and appeared to be an average - albeit young - village, nobody though twice about genins taking the exam.