It was done less for taxation purposes and more for representation in government purposes.
The compromise was made because slave states wanted slaves to count 100%, which would have given them more representation in congress.
Anti-slavery states said they should count as 0%, since they could not vote.
The two issues, taxation and representation were both linked to the counted population, but taxation was not on the mind of the anti-slavery people. Not to say taxation wasn’t part of it, but it was far from foremost as the driving force in the compromise.
It was all about representation in Congress, not about taxation, even though the two are linked. The anti-slavery states did not want the slave-holding states to have (to them) an artificially high level of legislative power assigned to them simply because they had slaves, which would have given them reason to have even more.
True, the 3/5ths compromise had to do with allocating representatives in the House of Representatives under the Constitution, but original formula of "five slaves equals three free men" dates back to the Confederation period.