Quite a few homosexual men do not engage in anal sex. I don't know how many, but it is significant. That being said, most do. Most also engage in other sorts of high risk behavior, such as drinking and drugs (inhibit the immune system), iv drugs, and promiscuous sex. These factors combined make homosexual men most at risk.
However, if you look at other high risk groups such as homeless people, iv addicts, alcoholics, etc., their HIV infection rate is just as substantial. This means that it's the lifestyle that causes you to be at risk, opposed to JUST engaging in anal sex.
Additionally, there are three main strains of HIV. One exists primarliy in the hetero non drug population. One exists in the drug population. The other in the gay men population. Supposedly, the gay men strain is the most contagious. But again, you must take lifestyle into account, before making any judgements about that statement.
Most people love to claim that homosexual men are at highest risk without even knowing what they are talking about. Probably due to ignorance and a little fear (one in the same).