Exactly. When you take on the job of being a police officer, you also take on the responsibility of acting more rationally than the people you are likely to be dealing with. You have to legal right to use force, and so you better be damned careful that the force you use is warranted.
This guy was an American college student of Iranian descent, born and raised in the USA. A U.S. citizen. I don't know what the circumstances were exactly before the cops arrived, but I just wonder, when the security in the library came around to check IDs, were they checking everybody in the study room or did they single him out (perhaps as one of several)? Somebody in this guy's situation has already probably been hassled for years about his descent, his name, his skin color. It's very likely he had a short fuse about being singled out, and did not react well. He probably should have reacted more calmly.
NONE of this justifies the cops' actions, in my opinion. Cops have a terribly hard job, but these cops reacted like a gang protecting their turf, not like representatives of the state. Not the first time this has happened, and it won't be the last. Thank God for video cameras.