Wouldn't the consequences of the world finding out that the govt. was hiding such an important thing be worse? Do you realize the revolt against the govt. that would happen? It wouldn't be pretty. It would be in their best interest not to lie about such a thing.
It depends entirely on the circumstances.
Let's pretend something really crashed at Roswell (I don't believe it, but it's a thought game).
It's 1947. The military responds, finds this alien ship. There are few enough people around that they think they can effectively cover up what happened and there's the advantage of being able to try to reverse engineer whatever technology they find. If they come clean, it's a big deal in the international community because everyone is going to think they have a right to have a peek at this alien shit. But who wants to play nice with the commies? And Americans might freak out. The country's recovering from the war, things are starting to look up on the American century. So however the conversation goes, the president and his advisors decide it's best kept a secret.
Time passes. Eisenhower's in office. Scientists aren't done trying to reverse engineer stuff. Can't let the cat out of the bag and share if they're not done with it, right? So he says nothing.
Kennedy's in office. There's Vietnam, more problems with the Cuban missile crisis, the bay of pigs, civil rights marches, etc. He's certainly not risking civil unrest and more confrontation with the international community.
Now it's LBJ's turn. It's been over 10 years since the UFO crashed. He's got the same problems Kennedy had and they're intensifying as revolutionary groups begin to become more serious, plus a president was just assasinated. He's certainly not telling the American people the government has been keeping this big secret.
And it just keeps going on. The political cost of coming clean becomes even bigger every step of the way. So while it might've seemed like a good idea to keep it under wraps when it happened, the political cost of revealing the truth becomes so prohibitive that no one would ever come clean until something forced their hand.
I don't really believe any of that, as I said, but I could definitely see that happening because of an initial, short-sighted decision. Governments are generally horrible at long term planning and forseeing the future costs of their actions (or at least properly estimating the probabilities and costs of various outcomes).