MOOC's for failed modules in PhD applicaiton
By and large, in the UK, MOOCs completion does not help your chances of admission; they are almost entirely ignored during the admission process. The only things that are considered are your results in your accredited degree programs. Paying for a certificate will not validate your MOOC participation in any way that Universities recognise; you should only pay for a certificate if you want a certificate for yourself, they do nothing else (take it from me, I lead a MOOC). 

The good news is that an excellent MSc result can do a lot to make up for a poor Undergraduate result. How you did as a postgrad is much more indicative of the kind of PhD student you would be than your undergraduate record. Consider writing a cover letter that takes your record head on, explains how you've matured as a researcher since then, that you are ready for real research, and your MSc is proof.