The official reasoning is to aid law enforcement tracing firearms in crimes. https://www.atf.gov/firearms/qa/why-does-atf-form-4473-ask-r...
If the underlying intent of requiring an ID for a firearm purchase from a gun dealer was to limit or discourage minorities from buying, then yes it would be racist.
I would argue that because government is predicated on force, a vote is nothing more than an act of delegation - asking others to use force on your behalf.
Less complex would be the legal argument, though: in the US, personal possession of arms is an enumerated Constitutional right. There is no such enumerated right to vote. From a purely legal perspective, why would it be racist to place an ID requirement on an act that is merely generally understood to be a right but not racist when applied to an act that is explicitly protected by the state’s charter itself?
There’s also the 14th’s “Privileges and Immunities” clause, but that has been weakened greatly through case law.
To my knowledge, there is no legal barrier to passing a law stating that only landowners can vote, or only people who are employed, or only people who have a net worth of greater than some arbitrary threshold.
There are lots of instances where a person may legally vote in one state, but not another. Virginia’s recent changes with regards to felons is a good example of this.