How did some English words get a "y" sound in front of "uː"-sounding vowels?
Solution 1:
Just guessing, but perhaps the /ju/, which came by breaking a high front rounded [y] in words borrowed from French, came to be regarded as a high prestige form. Then, hearing /u/, some English speakers interpreted that as a mistaken or low-class way of saying /ju/ and decided to correct it in their own pronunciations. If that's right, the /ju/ from earlier /u/ should turn up in words most easily interpreted as having been borrowed from French. Folk loan phonology.