Wikipedia's article on Focal length explains pretty clearly (emphasis mine):
In most photography and all telescopy, where the subject is essentially infinitely far away, longer focal length (lower optical power) leads to higher magnification and a narrower angle of view; conversely, shorter focal length or higher optical power is associated with a wider angle of view. On the other hand, in applications such as microscopy in which magnification is achieved by bringing the object close to the lens, a shorter focal length (higher optical power) leads to higher magnification because the subject can be brought closer to the center of projection.
So it basically depends on the fact that most of our astronomical sources are at distances larger than $\sim10^{18}$ cm away from us, while our microscopic objects are less than $\sim100$ cm away from us.