I raised three kids as a single, divorced mother. My kids are in their early 20's now and are well-adjusted, independent, responsible people. So, I did something right.
You shouldn't beat yourself up wondering where you went wrong. You did nothing wrong, nor did your husband. You are a wonderful parent who cares about her son. With all the things happening, like the Sandy Hook shootings, it's hard for children to know how to process how they feel. It's shocking and frightening for a child to realize that the world isn't a safe place for them. That's a lot to process for a child.
What I learned, from my kids, was that whenever they would act out, do, or say something inappropriate, it was because something was bothering them. When I sat down and talked to them, I mean really listened to them, and help them deal with the feelings and insecurities they were unable to process, both of us understood where the behavior came from.
To this day, when something is bothering my kids, they want to call and talk to me about it, because they know, mom, will help them deal with it. Hope that helps.