URLs are not regular text
Using a monospace font is not pleasing to the eye, […]
Yes, but then reading URLs isn’t very pleasing anyway. So, think about for a second why you typeset a URL anyway. Nowadays, you often do not need to do this at all, because in almost any digital medium you can equip some human-readable text with a hyperlink, which is more comfortable for everybody involved. If you actually need to typeset an URL, it is usually for a printed medium and then it’s not for being read like regular text, but for being translated to digital information, usually by a reading and typing human, sometimes by an OCR software.
With this in mind, the criteria for typesetting URLs are a bit different than for normal text. Regular text contains a lot of redundancy that enables us to quickly read it – even if we get some detail wrong, our brain can easily auto-correct it. This doesn’t apply for URLs: The reader has to get every character right. As always, with readability, concern is not that the reader makes unfixable mistakes, but rather that they do not waste a few seconds re-reading to locate their mistake and that they are not annoyed.
Another relevant consideration when typesetting URLs is that some characters are used differently than in normal text and thus fonts designed for normal texts are usually suboptimal when applied as they are.
For example, the baseline dot (.) is usually used to mark an important separation in both, normal texts and URLs.
When used as a full stop in normal texts, it is followed by a space, which optically supports this function.
This does not apply to URLs and in particular kerning may lead to the dot being much less prominent than it deserves to be.
In another example, uppercase characters are much less common in URLs.
If you look at the top example, the first thing that will probably catch your eye is the all-caps 47ATX, which is bad as it is not particularly important and if you want to type that URL, you usually want to start at the beginning.
This problem is at least alleviated on the bottom due to capital letters being relatively smaller in height as well as in width.
The main structure of the URL is much easier to parse in the bottom example as the dots, hyphen, and slashes are given more space, in terms of glyph width and kerning.
The m is not particular beautiful in the bottom example: It looks rather squeezed and the shortened middle stem is out of place. However, it is clearly an m and cannot be mistaken for rn. While this is a problem for every kind of text, misreading such an aspects is considerably more annoying with URLs as you won’t notice it instantly but have to go back and spot your mistake after you got a 404 error or landed on a porn site.
What does all of this have to do with monospacing?
While none of the above aspects is strictly tied to a font being proportional or monospace, your average monospace typeface is better suited for typesetting URLs than your average proportional typeface.
However, if you are aware of the disadvantages of regular proportional fonts, you can also address most of them without changing the font, in particular by adapting the spacing.
So, at the end of the day, you have to find a compromise considering the following factors:
How well does your monospace font match the regular font?
How many URLs do you have to typeset?
How long and complicated are your URLs? For example, www.example.com is more benign in terms of readability with a regular font than the above example.
How much time and effort do you want to invest?