The electronic properties and optical response of ice and water are intricately shaped by their molecular structure, including the quantum mechanical nature of hydrogen atoms. Despite numerous former studies, a comprehensive understanding of nuclear quantum effects (NQE) on the electronic structure of water and ice at finite temperatures remains elusive. Here, we utilize molecular simulations that harness efficient machine-learning potentials and many-body perturbation theory to assess how NQEs impact the electronic bands of water and hexagonal ice. By comparing path-integral and classical simulations, we find that NQEs lead to a larger renormalization of the fundamental gap of ice, compared to that of water, ultimately yielding similar bandgaps in the two systems, consistent with experimental estimates. Our calculations suggest that the increased quantum mechanical delocalization of protons in ice, relative to water, is a key factor leading to the enhancement of NQEs on the electronic structure of ice.