The 47-year-old actor is said to have cheated on Spelling, 40, with a woman named Emily Goodhand, 28, reported Us magazine.
The actor voluntarily checked into rehab, according to his representative.
"I am truly sorry for the mistakes I have made and for the pain I've caused my family," McDermott said in a statement.
"I take full responsibility for my actions and have voluntarily checked myself into a treatment center to address some health and personal issues. I am grateful to be getting the help I need so I can become the husband and father my family deserves," he added.
The couple, who has been married for seven years, are parents to Liam, 6, Stella, 5, Hattie, 2, and Finn, 16 months.