Question: Why does the Machatzis Hashekel hold one can medicinally wash out his eye on Shabbos to prevent his whole body from aching but cannot do so on Yom Kippur?
A. One may do something for severe medical purposes on Shabbos as long as it does not look like it is being done medically. For example, sucking on a hard candy if you have a sore throat.
B. One of the prohibitions on Yom Kippur besides eating and drinking is washing or anointing for pleasure.
C. In regards to melacha things aren’t prohibited on Yom Kippur any more than on Shabbos for the most part.
Answer: Since one cannot washout out his eye on Yom Kippur then even though it is permitted on Shabbos even for medicinal purposes in certain circumstances because it looks like it’s not for healing, nevertheless since you can’t do it for pleasure on Yom Kippur then it looks like you are doing it for healing, therefore it is prohibited (See Dirshu Mishna Berura 614:1:2:4).