The problem isn't focus, it's tracking rate. Hubble can take pictures of the moon, but not long exposures; it can't spin fast enough to follow the moon through its field of view, so it has to point where the Moon is going to be, then take the picture at the moment it passes through. https://what-if.xkcd.com/32/