How is that not illegal?
It is not illegal to check if someone voted. It would be illegal to find out how they voted. It this case, per the article, he didn't vote in 2016.
They checked if he “cast” a vote in the 2016 election which is public information....He did not.