That's actually not true. At a certain size of company and especially if the company does work for the federal government they are required to gather demographic information to ensure they are trying to not just have a bunch of white dudes applying for their job. Those questions should not influence the hiring process at all (if they do then it's illegal since those are protected traits).
If you don't want to answer them then just answer it by stating you don't want to tell them. It's an option on every application I applied too.