Why are Jewelled Foils much more preferable to Harpy Rapiers for modding?
Simple and straight answer - because for one hand weapons (for the longest time now), added damage from other sources is King. The latest PoE patch launched alongside legion league just cast that in stone.
If you have two weapons with the same nominal dps and then you use cyclone which adds another flat 50 phys dmg on top - the only stats on the weapon that scale that are crit chance and attack speed (crit multi is a weak stat in general on weapons). This is highlighted massively in the case of elemental attack builds/weapons where significant flat damage is added in on top via anger/wrath or a gem link like added lightning/cold.
This effect is much more muted for 2 handers - because all the flat sources remain the same! in 2h vs 1h and are of course much much lower relative to the massive base dps of 2-handers - so in comparing 2 handers APS is less of an issue for pure dps.
Also, another big point is that in most of PoE content - builds commonly do anywhere from 2-10x the dmg needed to kill white mobs in a single hit, and at the same time a large number of the best movement skills are rate limited by your weapons APS (leap slam / whirling blades etc). So a faster, even lower dps weapon can effectively clear maps and content faster simply due to moving along faster. From someone who's wasted over 6 years and counting on the game, the ingame feel of using a slow weapon is anathema compared to a fast one - funnily enough especially for 2 handers! Because they hit too hard anyways.
EDIT: for the purpose of your question, a much more interesting case is the one between a jeweled foil and a spiraled foil and the massive premium between them in most PoE trade leagues.
From what I can tell between the Jewelled Foil and the Harpy Rapier is that as of patch 3.7.3, the Jewelled Foil's higher attack speed leads to marginally higher overall DPS potential.
Regarding the higher base physical damage and higher global critical strike multiplier implicit, both of these matter little in this scenario compared to the attack speed as it scales very well with the flat physical damage.
I've just tested with my build in Path of Building.
I've created this two weapons:
Jeweled Foil
Physical Damage: 32-60
Critical Strike Change: 5.5%
Attacks per Second: 1.6
DPS 73.6
and
Harpy Rapier
Physical Damage: 31-72
Critical Strike Change: 5.7%
Attacks per Second: 1.4
DPS 72.1
As you can see Foil's basic DPS is a bit better.
When I try to switch between them, here is difference:
When replacing Foil with Rapier:
When replacing Rapier with Foil:
So attack speed is more important when calculating total DPS.