This is true only when a specific law creates a specific protected class. Discrimination is legal by default. An employer can freely choose who it associates with. It only becomes illegal when a specific law makes it so.
Protected classes in most US jurisdictions include characteristics like gender, race, religion, some medical conditions. Age is a protected class only over age 40; discriminating against a worker of age 39 for being too old, or favoring workers over 40, is entirely legal. I don't know offhand if family status of kids is a protected class.
But protected classes don't include a lot of things that people commonly think they do. Some example non-work factors that are perfectly legal to discriminate on because there is no US law protecting the class: smoking, obesity, height, car you drive, method of commuting, sports team favoritism.