So why couldnt one of the shuttles be rigged up to orbit the moon? it certainly had room in the cargo bay for a lander.
Take a look at the shuttle on the pad. It needs all the fuel in the external tank plus both solid rocket boosters
plus a little kick from the onboard manoeuvring system to reach the 17,500 mph it needs to achieve to go into Earth orbit. To reach the Moon it would have to achieve a speed of 25,000 mph, and it has nowhere near enough fuel left to get that extra 7,500 mph push.
But that's only the first issue. It not only needs enough fuel to do that, it needs more fuel to brake into lunar orbit and then break out of lunar orbit once the mission is over. There are two big problems with this need for extra fuel. The first is that there's nowhere left to put it. The external tank is empty and gone. The SRBs are spent and discarded. The main engines (SSMEs) are the only engines with enough power to affect these changes in velocity, and they are fueled from the external tank. You'd have to hook up the shuttle to another fuel supply. The shuttle orbiter is designed to be hooked up to the external tank by technicians in an assembly building, not by a suited astronaut on a spacewalk. Even if you could hook up another tank of fuel, the SSMEs are not designed for restart capability. They fire once, then they have to be stripped down and re-worked before they can be fired again. You could use solid rockets instead, but there are no attach points on the shuttle for such things. Even if there were some added, solid rocket boosters are not the best solution for a man-rated vehicle in deep space due to their 'turn them on and they burn till they're done' nature. Any mistake would be disastrous.
And then even supposing the shuttle did go to and from the Moon, it would then have the problem of encountering Earth's atmosphere at about 25,000 mph after the translunar coast rather than the 17,500 mph from Earth orbit. Not only is the shuttle's thermal protection system not rated for the level of heating this would cause, the shuttle's structural assembly is not built to withstand the aerodynamic forces involved at those re-entry speeds.
So, by the time you have re-engineered the shuttle to give it restartable engines, the ability to be connected to a new fuel tank in orbit, and the structural strength and thermal protection it would need to re-enter Earth's atmosphere at translunar speeds,
and constructed the systems needed to put the extra fuel tank up there for it to connect to, you might just as well have spent the cash on a purpose-built lunar spacecraft system. Re-working the shuttle, a vehicle designed solely for transport to and from low Earth orbit, to go to the Moon is like re-working an articulated lorry to make it amphibious so it could do overseas delivery of freight. Time consuming, expensive and not the best use of resources.