It is important to remember that the primary duty of a military pilot is to remain in control of the aircraft to the realization of his or her mission. While we generally think of the return flight and landing of the aircraft as an important part of that mission, the use of safety gear remains important even for a kamikaze pilot.
Planes attempting to strike ships were generally under a great deal of anti-aircraft fire as well as being engaged by enemy air forces. The use of helmets and goggles by these pilots served a function in the event that enemy fire resulted in damage to the glass canopy which covered the cockpit. In such an event, the protective gear was intended to assist the pilot in successfully guiding the plane to its target.