"Sections 162 to 165 of the Kenyan Penal Code criminalize homosexual behaviour and attempted homosexual behaviour between men, which is referred to as "carnal knowledge against the order of nature". The penalty is 5 to 14 years' imprisonment. The age of consent is 16. Lesbian relations are not prohibited in the law.
Homosexuality remains criminalized in Kenya, and even though there are few prosecutions in the country on the sections of the penal code, that criminalize it; LGBTI people are routinely harassed by the police, held in remand houses for long without charges being preferred against them, and presented in court, on trumped-up charges. Closely related to this, is a cartel of corrupt police officials who routinely extort and blackmail LGBTI people with the threat of arrest and imprisonment if they do not give them bribes.
According to the 2007 Pew Global Attitudes Project, a strong 96% of Kenya residents said that homosexuality should be rejected by society, making it one of the highest rejection of homosexuality in the 44 countries surveyed."http://en.wikipedia.org/wiki/LGBT_rights_in_Kenya
Religion is the number one reason why there are many anti-gay views in Africa.
http://news.bbc.co.uk/2/hi/8528409.stm