High optical to X-ray polarization ratio reveals Compton scattering in BL Lacertae's jet