> I think it was in fact the case that employing freer labourers would have been better for the economy before slavery ended
It was! Hence why the industrialized parts of the United States (ie. the north) had gotten rid of slavery much more quickly. Slavery existed in the rural parts of the country where the class of wage-labourers was not established yet.
The existence of slavery in the New World (a separate topic from slavery in antiquity, or rare instances of slavery in medieval Europe) was mostly linked to export of cash crops to Europe. With the genocide of Native Americans and the influx of agricultural land-owners, you had a problem: there was no labour. Without established cities & industrial production, the class of wage-labourers wasn't sufficient to satisfy this need. Therefore, they imported slaves. With the development of the proletarian class in the 18th and 19th century, this practice became obsolete, remaining only in the most undeveloped parts of the country.
In Europe, after antiquity, slavery was mostly done away with due to the Catholic church forbidding slavery of Christians and economic development which never favoured slavery; there was no external stimulus on agriculture like in the New World, so you mostly had serfs subsistence farming while being heavily taxed. Industrial production had its part in doing away with serfdom here as well: in order to supply the growing proletarian class, the serfs needed freedoms previously denied, like the freedom of movement.
This is a sketch of the materialist perspective on the progress of rights with the development of capitalism. Capitalism, as a system in which labour-power is freely traded as a commodity, is in contradiction with all means to suppress the free flow of labour-power and hence with restrictions on people's freedoms.