You have it backwards.

Why is profit a goal? It's nolever a goal in and of itself, it can only ever be an instrumental goal. "With profits, we can achieve <goal>".

If profit is the main goal of all economic activity, then we are doomed to destroy humanity and the environment.

Profit is the main goal of all economic activity. Economy is an activity of making and moving money around, which is only possible if you make profit.

But this only makes profit the root goal of a certain class of economy, not the actual root goal.