Who says that they did keep it a secret? How's this for a timeline:
The NX-01 encounter the Borg. Dr. Phlox figures out how to de-assimilate people. The Borg send a message to their home world to come assimilate Earth.
Archer rights up a report and presents it to Starfleet. Starfleet files it away but some scientists/security personnel are probably interested in this unnamed species and maybe they put some work into researching them. But with no further information or contact there's not a lot they can do so they move forward with other work.
With the Xindi crisis and later the Romulan War, the files on the Borg get put way back on the back burner and forgotten.
100 years later the El-Aurian refugees that Kirk saves mention that the Borg destroyed their home world (Who knows how long ago). Someone at Starfleet may have put 2 and 2 together to connect the Borg to the unnamed species that was encountered by the NX-01 but maybe not. Maybe the El-Aurians weren't forthcoming with details? (They're listeners, not talkers). But again, if Starfleet Intelligence did think that the Borg & the unnamed aliens were the same, what could they do? They have no additional data or contact so the info returns to the back burner.
60-70 years later the Hansen family stumble across the information and start working on researching the species. The more they look into it the more credible evidence they discover. They might have connected the two incidents or they may not have. Regardless, they took off to go find the Borg and we know how that ended.
Years later the Borg receive the message that the time traveling Borg sent in the 22nd century and attack and assimilate colonies near the Federation/Romulan neutral zone. No one suspects the Borg because why would they?
The next year Q sends the Enterrpise to meet the Borg. Starfleet finally learns the name of the species.
Starfleet then assembles a team (including Shelby) to research the Borg. The team may or may not have connected the Borg to the 22nd century incident. (The probably did at this point).
The next year BoBW happens and the Borg become common knowledge. Dr Crusher researches how to get cybernetic implants off of people and hits on Dr. Phlox's work which helps her de-assimilate Picard.
Years later the crappy Borg storylines in Voyager happen.
So I think it's not a matter of a cover up but just not realizing that different incidents were significant and related.