Is it okay that the earth wire is exposed when installing an outdoor security light?
Assuming that it's twin and earth wiring (which it sounds like from your description), yes the earth wire in the cable is typically uninsulated once the outer sheath has been removed. It's usual to use a piece of yellow and green sleeving to slip over the earth wire to provide basic insulation.

I'd recommend that you run the outer sheath of the cable into the junction box, or you could likely run into water ingress issues in the future.

As to why it's exposed, I'd hazard a guess that it's a cost saving measure to avoid the additional insulation. Except in a fault condition, there should be no current in or potential on the earth conductor, so it doesn't need the same level of protection as the line conductors.