Hamilton-density as a gravitational source

Why can’t the Hamilton-density of a field be the source of gravity, and why would it have to be the energy-momentum tensor? Would it behave correctly under Lorentz-transformations?