Why does a gene have two alleles? When there is a gene for producing the color pigment for a flower, why are there there two alleles, producing either same color or different color (homozygous and heterozygous)?
Allele is a variant form of a gene. How many alleles there are depends on number of copies of the gene and number of variants. In theory you can have 5 identical copies or single copy and single allele (Y-linked genes come to mind).
Regulation is very complicated, I'll refer you to reading on recessiveness, dominance. Barr bodies also have to do with various expression profiles in same thing.