Slavery did exist in all the states you mention. But by the time of the Constitutional Convention in 1787, Pennsylvania, Massachusetts, New Hampshire, Rhode Island,
and Connecticut had all outlawed slavery. New York would outlaw slavery in 1788 when the Constitution was ratified. Vermont had also outlawed slavery by the time of the Constitutional Convention.
Yes, the North had a sordid history making money buying and trading slaves. Yes, the North made money selling slaves. Making money working slaves. Making money trading with other slave states. Making money manufacturing textiles with slave-grown cotton. Making money transporting slave-grown cotton overseas and making money transporting European goods paid for with profits from slave-grown cotton.
And yes, the North made infrastructure improvements with import tax revenue from slave-grown cotton.
But in all of this, the North had a high moral standing because every time a northerner cashed a big slavery dividend check he would turn to the closest Puritan and announce loudly, “I accept this money under protest.”