Because words that are spelled with ij originally had a long i sound. However, that changed to a ei sound and hence ei and ij sound the same. On the other hand words that sound the same can have a different meaning depending on if it is spelled with ei or ij.