Why is it that heterozygous loci appear as two separate bands during gel electrophoresis while homozygous loci appear as one band?
A heterozygous locus has two different alleles and therefore it is possible that their DNA sequence lengths are different. However, it is unlikely that they are so different so as to be clearly resolved in a gel electrophoresis. Agarose gels can at best resolve 20bp; polyacrylamide gels can resolve smaller differences but it is only done for small DNA fragments.

I think upto 50bp difference is possible between alleles. But such huge insertions/deletions are rare and the difference between the alleles is usually a point mutation or small insertions/deletions(indels). Big indels are possible when a transgene is inserted specifically in one chromosome; these cases are mostly experimental.

If you consider paralogs as alleles then they can be of different lengths and can be resolved in agarose gels— usually the difference is in the untranslated regions. If you are doing Southern blot and using a probe that can bind to both paralogs then you will end up getting two bands. 

Having said that, it is possible to see a difference in gel bands even if there is no size difference. This is possible by a technique called RFLP. In this technique the DNA is digested using a restriction enzyme which basically cuts the DNA at a specific sequence (usually a hexamer). If a point mutation abolishes or creates a restriction site then the fragment length would be different between the alleles. This is detectable on the gel.

A similar technique is AFLP.