Salt provides essence and taste to food; no one prefers having bland food, hence the saying "take it with a pinch of salt".
In this sense Jesus says that people are the essence of the earth, the planet, it is no longer good for anything, except to be thrown out and trampled underfoot.
The planet's survival is based on the mere existence of humans. Humans are like salt they provide the flavour to the food, too much or too little can spoil the taste of the food (earth). They, humans, like salt have the power to turn earth into something better or worse depending upon their essence (flavour).
The essence of salt is its flavour, the essence of a human is his conscience, most commonly referred to as a person's soul.
If salt (humans) loses i's flavour (essence), it's of no use to anyone or anything.
And as a matter of common sense something that is not useful to anyone is disposed off without thought or second consideration, - I mean would you keep something that you find useless? Hence the words "It is no longer good for anything, except to be thrown out and trampled underfoot."
I hope this a good answer for the words that Jesus used-
As with reference to the verse Matthew 5:13:
13 “You are the salt of the earth. But if the salt loses its
saltiness, how can it be made salty again? It is no longer good for
anything, except to be thrown out and trampled underfoot.
Thank you for your patience