Any why is not fair that we as a society have a look at ourselves? Society cannot devolve any responsibility by just saying 'we do not support what this person did and as they are mentally ill then hey, what can you do'?
Of course you cannot control the actions of someone who is mentality Ill enough to do something like this. But in addition to better care of the mentally ill, you can look at the society that these people exist in, whether it be a culture of easy access to guns, a culture of religious intolerance and fundamentalism or a culture of promoting fear hatred by the media and by both sides in political debates. There is a hell of a lot of mental illness in society at some level.
Mentally ill people do not live in a bubble, they are exposed to society and will absorp this as much as anyone else who listens to politicians fear mongering, reads the papers, listens to the radio, goes on social media. I am not suggesting there was one single trigger for what happened. But I imagine most people who commit atrocities like this have some mental issues and just using that as a reason for why they do this without looking at the environment they live in is IMHO a bit naive.
Whilst I agree with you that there is an element of restraint society can exert on itself that might limit the negative/extreme stimuli an individual might receive, I do feel it is also naive to expect society to be that disciplined. The window of behaviours that society tolerates, although finds unacceptable, is huge.
And then there is the (warped) perception a damaged individual might take onboard.
Society has a responsibility for its own behaviour but not how the individual interprets the stimuli.