The issue with solar panels is the mass and complexity of such a system. Firstly, any meaningful solar array is going to need to be big. But you can't launch with solar panels extended, that would result in a stupid looking and unaerodynamic fairing (or in the case of the American Space Shuttles (STS) panels breaking) So, you need somewhere to stow them.
In standard spacecraft such as the Apollo CSM, this isn't so much a problem, they can be stowed out of the service module. But for the shuttles, they would have to be stowed inside the shuttle, among the OMS fuel and the OMS oxidiser, reducing the space for said fuel and oxidiser.
That's not the only problem, also the batteries needed for the dark side of orbit very heavy for the energy they store, and in the end, for the distance these are going, (to the Moon and back at most) it won't take too much time so therefore the fuel cells and fuel are cheaper and smaller. And they can be put anywhere convenient. Sure, solar power and batteries are best for interplanetary travel but for short flights, fuel cells are lightest, thus needing less fuel.
THE BOTTOM LINE:
Fuel cells are the lightest for journeys within Earth's gravitational field, and solar power with batteries is lightest for interplanetary missions.
And the ISS uses solar power because it's up to stay and doesn't need to change its orbit (save for the odd bit of space junk) and fuel cells on the ISS would need resupply missions every day or so.