How much does the ranking of your Master's program/school matter when applying to PhD programs?
Don't get hung up on the ranking thing because it doesn't really matter when it comes to a PhD admission.  Top things that make your application stronger are


Skills you gained during MS and prior education/work experience
Letters of recommendation (high impact)
Writing sample (usually your statement of purpose/intent)
Willingness to learn new things
Your vision for a future career


That being said, try to find a program (either MS or PhD) that is best suited to your interests and that has the faculty expertise for you to learn from.