There are two questions that keep getting mixed up in this issue:
a) Whether the actions of Mr Saleem were legal
b) Whether they were moral.
People equate legal=right, illegal=wrong. It doesn't work that way. What is legal is not necessarily right or moral. If you have doubts simply think that laws change between countries dramatically and laws that existed many years ago are considered wrong today and have been scrapped. Every era has its own morals that get shaped in various ways from different actors and factors.
Therefore, under the British law system what Mr Saleem did was illegal, thus he has to be imprisoned according to the legal guidelines for his action.
However, the social moral compass seems to side with him. Many people consider what he did 'righteous' and justified considering that his family and property were under threat and he was in no calm state of mind. Let us not forget that humans are to a large % animals and have such insticts as well. Whether you concur on the morality of the action is a completely personal issue (I would assume a Sharia supporter to consider it moral, while an extreme left-wing liberal to consider it immoral for example).
So stop debating whether he did 'right' in relation to whether he should be locked up or not. They are different animals and can't be necessarily mixed in some cases, such as this.
cheers