The incident was unfortunate, and I wish the mass media wouldn't make such a big fuzz over it for all the other crazy copy cat killers.
Private gun ownership is a very controversial issue. In many countries where private ownership is permitted, you could buy guns and ammo at age 18. Here in California, the minimum age to purchase "long" guns (rifles, shotguns) and ammo is 18, and for pistols is 21. Only in recent decades did they implement restrictions like waiting period and tougher background checks.
In Argentina they had a mentally ill person who went on a rampage and shot people at random on the street. By law he wasn't a convicted criminal, so even if you did a background check with the police, it'd have been legal for him to purchase the gun and ammo. And if we were to restrict "mentally ill" from buying weapons, then we'd have to decide what type of mental illness, to what degree, what type of restrictions (cars are just as dangerous when used to run people over), and sharing of patient's medical data with the police and possibly even the public. Going on a slippery slope here -- do you want to be denied a driver's license just because you saw a doctor? This is not an easy question to answer.