What are the ways I can demonstrate to the PhD admission committee that I am a highly motivated applicant? I have a STEM background. After failing in the CS MSc program, I got enrolled in a graduate program in Education. I was originally heavily motivated to do a Ph.D. in CS. But, after failing in CS, now I want to go for a Ph.D. in Education.
What are the ways I can demonstrate to the Ph.D. admission committee that I am a highly motivated applicant?
(I'm a computer science professor; I regularly evaluate applications for my department's graduate programs.)
You are asking the wrong question.  You don't want to show your motivation; you want to show your research potential.
It really really really Does Not Matter how much you want to do a PhD in computer science.  Sure, all else being equal, we prefer to admit students who are excited about joining the program, but at a fundamental level, we assume that if you aren't motivated, you wouldn't have applied.
What we do want to see is concrete evidence of your future potential for computer science research.  Make no mistake: Your &quot;statement of purpose&quot; or &quot;statement of motivation&quot; is actually a research statement.  What are your research interests?  What is your research experience?  What are your research goals?  What specific expertise can you apply to your research?  What open problems do you think are cool?  How do you want to attack them?  We are looking for both personal and technical detail, written in the idiomatic language of researchers.  (Even if you're not a researcher yet, even if you don't know what your specific research interests are yet, that's the voice you should strive for.)
We do not want to read about how inspired you were by your first smart phone, or who many programming languages you know, or how you've been programming since you were in the womb.  Yeah, yeah, we've all been programming since we were in the womb.  What have you actually done?  And what do you want to do that nobody else has ever done?
Part of that concrete evidence is your scholastic record: In short, grades.  Normally these only matter if they're low, but yours are low.  So in addition to the discussion of your research, your application also needs to address the elephant in the room: You need to give at least a brief explanation of what went wrong in your MSc program, and you need to provide evidence that the same issues won't arise again.
All of this evidence needs to be visible not only in your statement, but in your letters of recommendation as well.
I strongly recommend reading Mor Harchol-Balter's advice on applying the graduate school in computer science, which is based on her experience at Berkeley, MIT, and CMU.  Her advice is also consistent with my experience at Illinois.