Both the RX 580 and the RX 5700 are gaming cards. The RX 5700 is simply a newer generation, it’s the better card, as the prices reflect. If you want to discuss “compute” oriented cards we should look towards the Radeon Instinct cards instead.
The GPU chips themselves are basically the same as the gaming variants, it’s more the firmware, drivers and amount of memory that’s different, sometimes some things get lasered off, like a few of the compute core clusters(Radeon VII vs Instinct MI50) or such, when it comes to the gaming cards though.
But since you are comparing different generations of gaming cards that is frankly irrelevant here.
Honestly it just comes down to price, if the two RX 580 are noticably cheaper as an investment, go that route. Otherwise you might as well go with the single RX 5700 since there are slight inefficiencies to a multi card setup.
Also be wary and warned that theres a couple of RX 580 variants that have less cores and are actually essentially RX570’s with double the memory.