Why we need the key property in the Upsert class if it is never used?
You basically said it yourself. The check is there to enforce that Upsert is used in ways that is compatible with all databases, including PostgreSQL, which needs it, as it does not actually support an UPSERT-like operation.

On MySQL, the key doesn't need to be specified as it is only supported on a table with a single unique key anyway:

https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Query!Upsert.php/class/Upsert/8.2.x


  This class can only be used with a table with a single unique index.
  Often, this will be the primary key. On such a table this class works
  like Insert except the rows will be set to the desired values even if
  the key existed before.