The ALMA spectroscopic survey large program: the infrared excess of z = 1.5-10 UV-selected galaxies and the implied high-redshift star formation history