Because the FBI was keeping the story under wraps at Ubanga/Holder's direction until after the election. They didn't want the Republican leadership to find out. Hence, a "whistle-blower" stepped in precisely to let the Republican leadership in on the story. And Cantor responded by (apparently) keeping the info to himself and letting the FBI know that it had a whistle-blower on its hands!
Ah the information did not come first to Cantor. Who else Cantor told aside from the FBI director has yet to be reported. My wild guess is that Boehner is the one that put the lid on the information. Personally I would not have minded if it all were kept quiet until Petraeus showed up to testify and a House Republican asked Petraeus on live tv, "When did President Obama know about your affair"?