If the Empire had thousands of warships at its disposal, why would the Rebels even be considered a threat (Several Imperial military leaders believed the rebels were a threat) to the Empire?
Same reason why the North Vietnamese were a threat to the United States armed forces... guerilla tactics.
The entire Rebel fleet at Endor only numbered a few dozen warships.
That was NOT the entirety of the Rebel fleet. It was only the size of the Rebel fleet that they could risk scraping together. Remember, if you lump a few hundred capital ships into one area, you're going to draw some attention, and that's precisely what the Rebels didn't want to do.
Furthermore, the Empire could only "spare" 23 Star Destroyers to deal with the Rebel fleet.
Again, wrongo. Remember, the Emperor was luring the Rebels into a trap. If he had a thousand Star Destroyers waiting for them at Endor... well, you get the same problem that the Rebels had above: That size of a force would be hard to hide, and the Rebels wouldn't attack, and then the Emperor's trap would have been wasted.
Besides, under conventional circumstances, 23 Star Destroyers should've been enough to mop the floor with the Rebel fleet.
Remember the quote from Mon Mothma in ROTJ: "With the Imperial fleet scattered about the galaxy in a vain effort to engage us..." Canon proof that the vast majority of the fleet was scouring Imperial space, trying to find the Rebels (although the Emperor had conveniently had his men avoid Sullust to trap them all...).
The United States is made up of several thousand individual cities. The entire Air Force only consists of a few thousand fighters/bombers. The navy only consists of a few hundred ships and at most a few dozen battleships. I believe the US only has a dozen carriers. That is all of the force that is necessary to defend the US and project its power.
The United States also only has 270 million people. The Empire had six or seven orders of magnitude more people living
on just one planet. Factor in the millions of planets in Imperial space, and if scaled up - from the dozen carriers that the US has - suddenly you realize that, compared to the United States, the Empire's stated number of 25,000 ISD's is pitifully small compared to modern military force numbers.
If you have the capability of sending a fleet anywhere in the galaxy in a matter of hours, you do not need to have a warships stationed at every planet. That isn't practical.
A lot of things can happen in a couple hours. It just isn't practical to NOT have a warship stationed at every significant planet. That'd be equivalent to the United States pulling out all policemen and firemen from all but its ten most heavily populated cities.
First, you have to have the ability to train millions upon millions of people to operate and crew that many Star Destroyers.
They do, apparently. That number is, again, less than one-hundredth of one percent of the population of a single planet (Coruscant, which is estimated to have at least 500 trillion people living on it). I doubt that the Empire is lacking a population base from which to draw numbers.
Second, in order to make thousands of warships, you have to have thousands of shipyards.
Or just REALLY BIG shipyards. The Kuat Drive Yards encircle the entire planet, allowing thousands of ships to be under construction at once. The Corellian shipyards are supposed to be even bigger. Then there's Bilbringi, Sluis Van, the shipyards assigned to Black Sword command...
In short, it was probably easier to spend its time and money on the Death Star projects than on thousands of Star Destroyer projects.
Actually, the Empire was capable of undertaking the construction of the Death Star without any noticeable loss to its total resources. They were practically using Star Destroyers to wipe their asses.