The joke is a pun.  To say something has a 'nice ring to it' means that it sounds nice.  'Ring' could also mean the wedding ring, which may in fact be a nice ring.
To many girls the word ' marriage ' has a nice ring to it .