Hardy-Weinberg equilibrium generalized to add inbreeding (non-random mating)
You're confused because you're failing to distinguish between 'identical' and 'identical by descent'. Some pairs of alleles would still be identical even in the absence of inbreeding. 

We model the inbreeding by classifying allele pairs as IDB - always homozygous - or not IDB -  distributed according to Hardy Weinberg. The frequency of a pair of alleles being A1,A2 (or A2,A1) is thus the frequency under H.W.E. (2pq) multiplied by the chance of them NOT being IBD (1-FI). And conversely, a pair can be homozygous and not IBD - at frequency p 2(1-FI), or because they are IBD - at frequency p F I.