The reasons why you may develop anal cancer aren't fully understood at present. Some factors that may increase your chance of getting it include advancing age, being female, having Human papilloma virus infection/genital warts, having many sexual partners, engaging in anal sex, smoking or having a weakened immune system from conditions such as HIV/AIDs or taking medicines that depress the immune system like steroids or anticancer medications.
Attribution: BUPA