The United States has about 100,000 people working in foreign intelligence, and that's costing about $45 billion a year. Both those numbers used to be classified. But the decision, five years ago, to create yet another office (the DNI, or Director of National Intelligence) to control all intelligence, has changed attitudes on what should be secret. This has upset a lot of people in military and intelligence circles, especially those in charge of developing new weapons and equipment. For decades, foreign nations (once the Soviet Union, now China) made efforts to obtain U.S. military technology. One of the more successful defensive techniques was the "black budget." This is a post World War II practice consisted of developing, and initially building, critical weapons and technology (including intel stuff) in secret. This method, which adds a few percent to the cost of the "black" (secret) systems, declined after the Cold War ended in 1991. But by the mid 1990s, it began growing again, and the amount of money in the black budget ($34 billion for next year) is now twice what it was 13 years ago. About 44 percent of the black budget is for procurement (14 percent of all procurement for the year), the rest is for Research and Development (24 percent of all R&D). Many intel people are upset that even these numbers are now out in the open. Back in the day, the money for black projects was hidden in other parts of the overall military (or even non-military) budget.
Thus if the enemy doesn't even know what is being worked on, or has to expend effort to just find out that much, they end up with fewer resources with which to steal really valuable stuff. There are other nations hunting for details on these projects, as the tech often has commercial uses as well. So painting it black isn't just to confuse the those seeking military secrets.
Another reason the military likes black projects is that it keeps the media off their backs until the projects actually working. During the R&D phase, there are all sorts of spectacular failures, which the media loves to jump all over. The pundits call into question the wisdom of projects because there have been failures during development. The media is pretty clueless about how R&D works, and don't really care. Scary headlines are all that counts. Most of the black projects work out just fine, but without all the usual media drama that accompanies non-black stuff.
Black projects do not exist entirely in the black. Congress, or at least selected (usually for their ability to keep secrets) members have access to details on how these undertakings are coming along. Of course, you can't always depend on elected officials to pay attention, but at least they don't always make stuff up and shout lies from the rooftops.
Finally, it's not clear just how much intelligence value (in terms of security) black projects, or intel efforts in general, provide. Any data on that aspect is classified. When the Cold War ended, and we could hear the Russian side of things on many Cold War era events, it does appear that the black projects kept a lot of information from the enemy. But part of that was because the Russians tended to be a bit paranoid about American technological prowess. The Chinese are rather more deliberate, and much less paranoid. It will be a while before we find out how effective the current use of "black projects" is in protecting secrets.