No it's not illegal, but it is part of the overall vetting process. To better explain my position, I just posted this on a thread about Biden, your candidate:
The thread is about Joe saying he doesn't plan to hold his opponents' pasts against them. Here's what I said. See what you think:
The best predictor of what you WILL do is what you HAVE done.
That said, all the senators and governors running have advocated the interests of people in their states, and this advocacy sometimes goes counter to the interests of the whole country. But they are doing their jobs because that is how our system works.
So on the one hand, I'm inclined at first blush to give them all, including Joe, a pass, with the caveat that they'd all better explain why they have evolved on those particular issues.
In terms of Biden, the example is that he was in fact one of four Dem Senators to support the 2005 bankruptcy laws. The mitigating factor was that Biden was the Senator for Delaware, and Delaware is where these credit card companies are all incorporated. So of course, if Biden is being a good Senator, he's going to support them. That is certainly what I'd expect from a Delaware guy.
However, as a presidential candidate, I equally expect that Biden would back off on that position, because if elected, he won't just be representing Delaware and its financial services companies, but all of America, which means all of the American people and all of the American businesses. So what I want to hear from Joe, is how he stands now on these bankruptcy laws, on predatory lending practices, high interest rates, student debt and so on. Because people ARE suffering because of that 2005 bankruptcy law.
You know who I really admire, because his honesty blew me away? Buttigieg. When Rachel asked him that hardball question about race problems in South Bend, he gave a completely honest response. That doesn't mean the problems are going away, but it does mean that people with integrity will now watch to see what he does now. He's got a tough row ahead with African Americans and may not make it, but you've got to admire his honesty, and pull for him to make successful strides forward with the AA community.
That's what I want to see from ALL these people. If Biden came out and said, "Yes, at the time I was one of the Senators from Delaware, and many of the credit card companies are incorporated and have substantial offices there. They were my constituents at the time and so I supported those bankruptcy laws. At this point, here is my position as a presidential candidate..."
That goes for all of them - Warren, Harris, Sanders, etc. They have all done it, and since it is in their records they must answer a) what I did then and why, and b) what I will do as president and why.
Do that, and we'll have a hell of a lot more solidly vetted bunch of candidates.