Many many times in US history we've said something is true, but put some big asterisks after them. Slavery is over (except it's definitely still permitted in the US), it's illegal to discriminate based on race (except we allowed redlining for generations and arguably are still fighting it), rape is illegal (unless it's your spouse, then it was legal until '93. And a lesser crime still in much of the country).
Voting is no different. Heck, one might argue we still don't have universal suffrage. People who want to vote but because we've put barriers like underfunding stations, long lines, not giving time off to vote, etc. we're clearly preventing some types of people.
When did all the voter suppression become illegal? 1965.