Mass and star formation rate of the host galaxies of compact binary mergers across cosmic time