In Season 3, Whistler was in prison and it was told that he could have killed the mayor's son, but it was hinted as being speculative. After watching Season 3 and the first part of Season 4, it is clear that Whistler is very smart and was working for the company. I imagine that he had better things to do than killing the mayor's son in Panama City? How did he come to Sona?
From Prison Break Wiki:
Before Whistler was incarcerated in the Sona Federal Penitentiary, he allegedly was a fisherman, running a charter boat between America and Australia. One day, he got a call demanding to know exactly where he took a naturalist of some sort, who took water samples and measurements. He then worked for Gretchen Morgan. He said he couldn't remember – but then government types started snooping around. When James had a bar fight, he killed the Mayor's son, leading to his incarceration in Sona. The people who are trying to get him out demand that as soon as they do, he show them where he took that guy. After he was transferred into Sona, he hid into a crawlspace as most inmates wanted to turn him in to The Mayor for their freedom.
My guess is, whoever was following him around (read The Company), was behind him being sent to Sona. They framed him for the murder of the Mayor's son so that they could use his freedom as leverage to extract the information. I say "framed", because Whistler doesn't come across a guy who would kill somebody in a bar fight. Moreover, he repeatedly proclaims his innocence to numerous characters (with a lot of conviction).