It depends on whether you are in the UK or the USA (or another country). The system is different in the UK in several ways.
1) You might get a "discount" on your PhD length if you have a masters in the same department.
I am not sure about other universities but for Oxford and Cambridge, many of their masters (or "MPhil"s) are meant to be the first year (or first two years) of the PhD program. A PhD usually takes 3-4 years in the UK, but if you continued directly from such a masters, it can be reduced to two years.
2) Your masters dissertation might count as your PhD project.
It depends on the department but at least for mathematics, there are people who use their master's dissertation in place of the first year of the PhD. Once again, I am unfamiliar with universities outside of Oxbridge. But at Oxbridge, the first year is usually spent putting together an in-depth research proposal outlining research goals, literature, and methodology. Then, students go through a "transfer of status" where their proposal is evaluated and green lighted as PhD dissertation. I suppose this is similar to qualifying exams in the USA, minus the coursework.
But if you have done all these during your master's, and the department thinks your master's dissertation is of sufficient quality, then it can count as your transfer and save you a year.
3) The research experience saves you time.
This applies to both the US and UK. It can take some time to pick up various research skills. Master's programs with a significant research component that allows you to pick up these skills can help save time. Sometimes, A LOT of time.
For the USA:
In the USA, based on what I have read (so far) on the websites of various mathematics departments, all PhD students have to go through coursework and obtain an M.S., regardless of whether they have a masters degree. This policy need not be universal. I suppose the best thing to do is to email the departments that you are interested in and ask about their policy.
P.S. I recently completed a master's degree in the UK and am applying to USA departments for PhD.