This is because in southeastern England /uː/ has developed two very distinct allophones: a truly back [uː] before tautosyllabic (or stem-final) /l/, but a fronted quality approaching [yː] in other positions. The kingly ruler, ˈruːlə, is taken as transparently bimorphemic, rule#(e)r, so retains the back uː of rule; but the measuring ruler, ˈryːlə, has lost touch with its origins and is taken as an unanalysable unit, with a corresponding clear l and fronted vowel yː.
This parallels the “GOAT split” that I described for London English in Accents of English (p. 312–313) and which gives us non-rhyming goal#ie vs. slow#ly.
As Uffmann comments, in his Facebook status update from which I have taken this,
GOOSE fronts to (y) but not before tautosyllabic L. This is complicated by morphology, so in king ruler you preserve (u), a neat cyclicity effect which is now leading to a phonemic split, for GOOSE and much more advanced in GOAT, which has acquired exceptions. For example, polar and molar have different vowels.
The l sounds are presumably different, too.
king r[u:]ler precisely because it is transparently related to r[u:]le, but desk r[y:]ler. I do think the l's are different, so this is something to look into.In the citation form of rule you would expect the l to be vocalized, making it a close back vocoid. But before a following vowel a linking lateral contoid is retained.
Christian also says
I was struck by the unanimity, because the informal surveys on the GOOSE/GHOUL and GOAT/GOAL split that I have done so far all pointed at a lot of variation. So while many people have [y:] in 'roulette', you do find speakers that have [u:], etc. The only other stable minimal pair with [u:/y:] that I had found previously was 'cooler' ([u:] )vs our esteemed colleague Nancy Kula ([y:]).
I think Brits just realised that without a three-way back/round opposition, you're not a proper Germanic language, so they're reintroducing the contrast.
I suggested that we may have a similar development in, for example, feeling vs. Ealing, failing vs. railing(s), where again the first of each pair is morphologically transparent, leading to an epenthetic schwa (“Breaking”) and a dark l as in feel and fail, whereas the second is seen as morphologically indivisible, so has a clearer l and no schwa.
The up-and-coming young scholar, possibly as yet unknown, who attempts a comprehensive new description of son-of-RP English phonetics will have to cope with a newly complex vowel system. Just as the vocalization of historical r and its effect on the preceding vowel gave us the centring diphthongs, so further new diphthongs are arising as a consequence of the the vocalization of l.