I just watched hunger games, and in the end Secana Crane was locked in a room with nightlocks, but why did they do that to him? what did he do to get killed?
He angered the President by failing to stop the contestants from beating the game, so his death was demanded.
The Capitol is a government that rules through absolute control. They're keeping the different areas under control through force, and everybody is too afraid of being killed to stand up to them. The Hunger Games are there to make people afraid of revolting and to give them some hope of one day becoming famous. Crane got killed because he allowed Katniss and Peeta to beat the game. The point of the Hunger Games is that there can only be one victor, but Katniss let them both live. By doing that, she showed that the Capitol couldn't control everyone absolutely, and they could beat the Capitol if they tried. Crane got killed because he let that happen. It also drives home to the reader how brutal Snow can be, and how willing to throw away a life he is.
President Snow killed him because he allowed the games to break its rules for the first time ever by having two victors. What Katniss and Peeta did was a sign of rebellion and the Capitol relented by letting both of them live, otherwise that there would be no victor. That was not supposed to happen and President Snow had already warned him to stop any signs of rebellion prior but Crane let it happen. Someone needs to be held responsible and since Crane is the gamemaker, he has to die. This is to show that no one holds greater power than Snow over the districts and Capitol and no one should defy him. Rebellion leads to death, no matter what your role is or how you might have contributed to it.