Is it pragmatically beneficial to pursue a master degree before applying for a math PhD in the U.S.?
The short answer to the title is yes, it can help for less competitive (foreign or domestic) students, as has been mentioned on this site several times (e.g. https://academia.stackexchange.com/a/42268/19607; see also How does the admissions process work for Ph.D. programs in the US, particularly for weak or borderline students?) but I can't find all the relevant issues in a single post.
For foreign students, there are a few different reasons why one might have trouble getting into a decent PhD program in the US:
you are coming from a very competitive location (e.g., east Asia) so by comparison you look weaker to many similar applicants; also, schools don't usually want to admit too many people from a single region
you have a horrible TOEFL score; unless your application is absolutely stellar, this will hurt you, as most PhD programs will need you to teach/TA undergrads
you come from a school that is not so well known in the US, so grad programs have difficulty assessing the value of your grades, coursework and letters of recommendation. letters of recommendation are very important in this case, but unfortunately many faculty at these schools don't know how to write appropriate letters of recommendation--I've often found all the letters for a candidate to be completely useless.
On the other hand, master's programs are easier to get into, so if you're having trouble getting into PhD programs, yes, it's a good idea to apply to Master's programs. Of course, before you apply, you probably won't know your chances, so my suggestion is if you are unsure, apply to some of both.
As for the benefit, assuming you go to a Master's program that is more reputable/well known, then coursework and letters there will count for more than at your undergrad for various reasons:
First, your study of more advanced material counts more.
(if you're comparing the value of work after you've done a master's program) How you have done most recently generally counts more than the more distant past.
The people reviewing your application are more likely to be familiar with the quality of education and the standards at this school. (At the least, you are coming from within the US system.)
Last and not least, your letters of recommendation are likely to be more meaningful, because the faculty at the Master's program know how to write letters for US PhD programs, and the faculty evaluating your letters are more likely to know the letter writers and how to interpret what they say. (Also, they'll be evaluating you on more advanced material, which is more meaningful.)