My doc perscribed " sulfacetamide sodium opthalmic solution" for my ears. However, it is treated for my eyes, is this a mistake?

No. No. Ear, nose and throat specialists or otolaryngologists often prescribe ophthalmic antibiotic drops to treat ear infections. They are safe and effective for ear infections.
Yes. Sometimes eye drops are prescribed for the ears. That is ok. At least in the past, the ph of eye drops was more neutral than the drops used only for ears.