This is a sovereign nation that is being attacked by a waning superpower. It's war and they are retaliating in really the only way that they can force America to back off - which is make the war really expensive and even more unpopular domestically.
However, even if it were a winning strategy, on the bet that the US will back off if the IRGC can inflict enough economic pain on US allies, it would still objectively amount to piracy and terrorism to attack merchant vessels not aligned at all to the US or involved in any way in the war. If you think the US or Israel has no right to attack and degrade Iran's military capacity to the degree they feel is necessary for their own security, you can't possibly say the IRGC somehow has a right to attack third parties to the conflict. If the disparity between who has the right to do what hinges upon who the aggressor is, consider that it was Iran which first fired a missile from its own territory at Israel, not the other way around. But in what case is a private vessel flagged in Malaysia and on its way to Japan or something a valid target? To say so would explicitly mean that every country in the world is fair game because Iran is at war with the whole world. If that's the case then what exactly is wrong with the world removing that regime?
You seem to be implying that whether or not it's successful, the Iranian regime's strategy is justified in some vague moral sense. That isn't an argument, it's a feeling. All it exposes is that you have a favorite side in this war, which is at least anyone who opposes America, if not the Iranian regime specifically.
Do you understand the concept of asymmetrical warfare? Hiding hundreds of launchers, firing them, and losing them is already accounted for by Iran, while a decent chance of losing any asset going through is prohibitively expensive. The strait is closed.