Two variants of signing transaction
Answer provided by @Andrew Chow:


  The benefit is that each signature commits to the inputs and outputs
  of the transaction so that they cannot be changed. If each input only
  commit to one input, then more inputs could be added and malleate the
  transaction. However, there is a sighash type that allows this: sighash
  ANYONECANPAY.