Drilling seems to require heavy equipment, preferably with humans on site for maintenance, much energy and might be even more problematic in low gravity and unknown geology. Deepest hole drilled in space was 292 cm by Apollo 17, manually operated on site.
Could a heavy drill be replaced by a rover dropping off a much lighter shaped charge, taking cover when it explodes, and returning to examine the debris from the deep which landed on the surface? Couldn't a modern shaped charge even cause a deep narrowish hole, rather than a flat crater, which could be inspected by "a ChemCam" and even by physically lowering down small instruments and tools? And then even by lowering down another explosive, much like construction and mining drilling on Earth often is done only in order to place explosives more favourably.
By blasting out a bay shaped cavity in a Martian or Lunar hill, radiation shielding and maybe thermal benefits might be provided for a habitat module later placed there. Explosives might make subsurface water ice much more available to a human space colony. With the advantage of using only a few tons of explosives which require almost no operational overhead, other than being placed by a rover. Even if a detonation gives an unwanted result, the investment lost was low compared to a heavy drilling station, and could be replaced by a new attempt on another site nearby.
What are the main problems which I optimistically leave out here?
Actual examples of explosives in space: Hayabusa2 will use a shaped explosive charge to create a crater from where it will land and take a sample (animation and an abstract of a paywalled article). That is more of a replacement for an impactor like Deep Impact, rather than for a drill. Except for explosive bolts, the only other use of (non-military) explosives in space I know of is Apollo 14, 16, 17 and that was for seismic purposes.
EDIT: Is there a way to roughly compare the launch mass and useful energy delivered of explosive devices compared to mining devices on the Moon, Mars, Asteroids given some performance criteria such as depth reachable or mass of rocks cleared? I imagine that explosives are pretty energy intensive payloads compared to solar powered machines.