Any iMac newer than 2014 is faster with single core performance than a Mac Pro with dual X5690, but the Mac Pro has better multi core scores, better thermals, can use 160GB of RAM, can have 5 internal disks, use NVMe drives into PCIe adapters, etc…
So, for some usage scenarios the iMac is better, since it's faster with single core performance, but have horrible thermals. Mac Pro is much more versatile and upgradeable, with very good thermals, but you are limited with single core performance. Mac Pros works weeks at full CPU usage without breaking a sweat, you can't use a non-iMac Pro like that, it will cook itself.
Single core vs multi-core - Which is more important depends on the apps you use. All apps can benefit from faster single core performance, not all apps can benefit from 12 cores.
160GB RAM - That's great if you need that much RAM, but how many people need that much?
Lots of internal drives - Yes. This is great. But all your drives will be limited to SATA 2 unless you use SATA 3 PCI-e card(s). This means that unless you use SATA 3 cards, SSDs will be bottlenecked when installed internally in a Mac Pro.
Upgradeable - By the time you add all the PCI-e cards needed to make the Mac Pro "modern", i.e. with Video card, NVMe PCI-e card, USB 3 PCI-e card, USB 3.1 gen 2 PCI-e card, SATA 3 PCI-e card, you aren't really left with much expandability anymore. All of that stuff is built-in standard equipment on a new iMac.
Thermals - There's no question the thermals are better in the old Mac Pros.