How does the family background mentioned in the statement of purpose affect a PhD application for admission in U.S.? Suppose there are two students applying for math PhD programs in U.S
Student A mentioned in his  statement of purpose that he was born in a well-educated middle class family with both parents scientists/mathematicians. He chooses to pursue math because he grew up in  excellent family circumstance and his parents told him that &quot;mathematics is the best field because it has an amazing internal consistency and a level of rigor and certainty unmatched by any other intellectual endeavor...&quot;(quoted from Dr. Pete L. Clark)
Student B, however, mentioned in his statement of purpose that he was born in a poor family with bad-tempered, quarrelsome parents who had never gone to colleges. His motivation for pursuing math is that he believes that knowledge changes fate, doing math can help him find peace while his parents are fighting and math research doesn't cost much money.
Given that A and B have similar GPAs, test scores,LoRs, undergraduate institutes, etc., does

A has an advantage over B in graduate admission because he grew up in a well-educated family so that the committee believe that A is more likely to be successful as a research mathematician than B(for instance, A's parents have strong social networks which can help A to be successful in the future) OR
B has an advantage over A in graduate admission because the graduate committee believe that it is much more difficult for B to achieve what he has achieved today so that he has more potential to be successful in math?

A further question is that if an applicant's family background is so unusual(good or bad, like A or B) that it affects one's motivation for pursuing math, is it better to mention it(to increase one's chance of admittance) or not to mention it(just for safe)?
How a statement of purpose is read varies from department to department, and from person to person.  That said, I think for most people reading your statement, it wouldn't matter much.  Yes, many people are for socio-economic diversity in admissions, so scenario B could be slightly helpful, but really this might only make a difference in very borderline cases.  (Of course, you should be truthful, and not claim to be Pete Clark's offspring if you're not.)

What's important about the statement is that we get some sense of your motivation and goals, and possibly mathematical maturity.  It's also good if your expectations about grad school sound realistic.  By the time you are applying for PhD programs, between your academic history and your letters of recommendation and a statement about your motivation/goals, we should have a good sense of your likelihood of success in our program without any information about how you grew up.  We care more about where you are now rather than how you got there, so to speak.

My advice is, if you feel it's useful to explain where you came from to explain your motivation/goals, then by all means feel free to.  If not, there's no need to bring it up.