There are a number of reasons involved here.
Firstly, as Clanad said, it serves to prevent accidental mechanical corneal damage with instruments etc during surgery.
Secondly, tear production is reduced or stopped during operations and as its important to maintain a moist cornea, the eyelids are taped shut. Sometimes, a thin layer of an special aqueous ointment is applied to the cornea before taping to aid hydration.
Thirdly, some operations require the use of powerful lasers and lighting equipment. Accidental exposure to such lights or lasers could lead to blindness. Special types of tape are used that are impervious to such lights and lasers.
Fourthly, my medical colleagues at uni tell me that on occasions it would not be not very desirable for a patient undergoing surgery to see exactly what's going on. Patients undergoing elective surgery have been known to panic when they see the vast array of equipment in the operating theatre or the operating theatre team around them. Taped eyes can augment the pre-med no end!