There are a lot of reasons for this to happen. Most times it is the tactic itself, especially your marking system in overall and how you set defensive line, roles and mentality. And if you're playing a league one side, try use defenders with good defensive attributes, rather than decent ones..
For starters, try set your match preparation to defensive positioning or defend set piece.
Cheers, and good luck..