Online MS degrees are necessarily course-based "professional" master's degrees, otherwise known as terminal master's degrees.
If you want to apply to a PhD program, you need to provide strong evidence of research potential. If you are applying with an MS, you will be competing with applicants in research MS programs, who almost certainly have more research experience than anyone with a professional MS.
It is nearly impossible to get that research experience without direct face-to-face contact with more experienced researchers. Even if you somehow learn to do research on your own, you still need recommendation letters that describe your research potential in specific and personal detail, and such letters are impossible to get without direct face-to-face contact with their authors. If you want to become a researcher, you have to do it in person.