Not all pirates wore eye patches for medical reasons. The eye patch could be used to prepare one eye to see in the dark, so when they would go below deck they could swap the eye patch from one eye to the other and see with the eye that has already adjusted to low light conditions. This would allow them to instantly see in the dark.