1) It Was Heavy For a Lunar Mission
The Space Shuttle was a heavy spacecraft, cca. 219,000 lbs (99 t).
The Shuttle's launch system was insufficient to launch it beyond low Earth orbit.
The Saturn V - one of the most powerful rockets - could lift the Apollo spacecraft & its lunar module to low Earth orbit (LEO) with its weight of 98,700 lbs (45 t). But that required lifting 300,000 lb (136 t) of weight to LEO, including the 171,000 lb (78 t) of fuel for trans-lunar injection
So even the powerful Saturn V wouldn't have been sufficient to launch the Shuttle for a lunar mission.
2) It Didn't Have The Proper Amount of Propellant
Let's say there had been a launch system to launch the Shuttle to LEO and prepare for trans-lunar injection.
Even then, the Shuttle couldn't have made it & back.
The Shuttle's tanks were not configured for anything other than LEO missions. It couldn't carry enough fuel needed - even - for a lunar flyby with a free return trajectory.
The Shuttle would've needed a massive amount of fuel from an external tank(s) to do such a mission.
3) It Didn't Have The Proper Radiation Shield
Crewed spacecraft going out from low Earth orbit and Earth's magnetosphere requires an extra layer of protection against radiation.
Especially against the Van Allen radiation belt that all crewed missions pass on the way to the Moon.
This is just the simplified reasoning why the Space Shuttle was not capable of flying into lunar orbit and back.
If you want to read a more detailed explanation of the topic, share it in a comment, and I will be back with a dedicated article in the Orbital Stories newsletter.