Joel says the nations scattered God’s people, divided up the land, and treated the people as property. These actions are listed as charges connected to coming judgment. See Joel 3:2–3.
Joel 3:1–3 opens with an announcement that a specific “time” is coming when God will reverse Judah and Jerusalem’s losses. In that setting, God says he will assemble the nations, bring them to a named valley, and hold them to account because of what they did to God’s people and land. This section follows Joel’s movement from disaster and alarm toward promised renewal and then to a climactic confrontation. The prophet has already spoken of restoration after devastation and of a future period marked by God’s direct involvement in events (compare the lead-in to this section at Joel 2:28–32).
Joel 3:1–3 presents a future “time” when God reverses Judah and Jerusalem’s losses (“restore the fortunes”). In that same setting, God also calls the nations to account. The text is explicit that God gathers the nations to the “valley of Jehoshaphat” and that the reason for judgment is how they treated God’s people Israel and God’s land.
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with Joel 3:2-3, then read the surrounding section so the answer stays connected to the passage's flow.
2I will gather all nations, And will bring them down into the valley of Jehoshaphat; And I will execute judgment on them there for my people, And for my heritage, Israel, whom they have scattered among the nations. They have divided my land,
3And have cast lots for my people, And have given a boy for a prostitute, And sold a girl for wine, that they may drink.