Joseph Smith tried to obey God while also protecting Emma’s feelings, and because those two things do not line up, he entered some plural marriages in secret, likely to keep Emma from getting hurt.
Joseph Smith seemed to have been trying to keep both God and his wife Emma happy. That was impossible, though, because God wanted Joseph to live the law of polygamy, and Emma didn’t. Joseph tried to obey God without hurting Emma by entering into some plural marriage without telling her.
Emma was extremely (and understandably) resistant to the idea of polygamy. She had periods when she tried to accept it (on the grounds that she got to pick Joseph’s wives) and then at other times denounced it completely, demanding that Joseph and the girls denounce their covenants to each other (Source).
Joseph’s brother Hyrum asked Joseph to write a revelation on the subject, feeling certain he could convince his sister-in-law of its truth. While it didn’t work, the revelation clarified that if Emma was faithful and accepted the law, she would be able to choose Joseph’s wives (this is actually called the Law of Sarah, after Abraham’s wife, Sarah). If she wasn’t, the Lord would choose Joseph’s wives (Source).
As a consequence of Emma’s (again, VERY understandable) resistance, Joseph, in certain circumstances, entered plural marriages without Emma’s knowledge, likely to try to spare her feelings (Source).
Unofficial Guide to Tricky Topics