You are correct.
The first one :
Pourquoi cours-tu… ?
is a direct question expecting a personal reason.
The second is a general question that can translate into
Why would anyone chase that treasure?
showing disapproval. It can either be a rhetorical question, introduce one’s personal view of the matter, or genuinely ask for a reason to change one’s mind. For instance, the person who asks might think that there’s no need to run when walking would do just fine. Or that they found enough treasures already.
The second can also be used as a fatalistic statement, akin to
Why chase that treasure?
as in your own example.
The second, however, can also be used without critical tone, for example as the title of a list that enumerates reasons to do so.
In (1) « Pourquoi est-ce que tu cours après ce trésor ? » there is two pieces of information:
- The one you are talking to is running after the treasure.
- You wonder what is his reasons for doing that.
In (2) « Pourquoi courir après ce trésor ? » there is only one:
- You wonder what could be the reasons to run after the treasure.
If you are speaking with someone who is running after a treasure, the neutral way to ask him why is (1) (or the equivalent « Pourquoi cours-tu (…) ? »). Using (2) in this case is critical. If you are not in front of someone running for a treasure, (1) doesn’t make any sense, so (2) don’t have this critical tone and you can use it.