CFHTLenS: co-evolution of galaxies and their dark matter haloes