The real issue was not giving the slaves the vote. It was that the slave holder personally voted on behalf of each of his slaves. If he had 500 slaves he personally cast 501 votes. the purpose of the compromise was to reduce the electorate power of the slave holder.
The purpose was to reduce representation in congress of the cotton states where a relatively high number of slaves lived, and to increase the representation of the northern states where relatively few slaves lived.
When the 3/5ths compromise was being debated slavery was legal in all states.
The record shows that of the 13 original states, 13 of them voted to enshrine slavery into the United States Constitution.
Voting had nothing to do with it. The purpose was to give slave states a disproportionate number of representatives in the House.