You can do both without doing business with the government though, so legality is not questioned.
Of course, there is a ton of gray area here that the courts will have to rule on, but the whole point the ACLU is making is that they believe these anti-boycott laws are in violation of the first amendment.
"Actually free speech means you can lose government contracts or you job as a government employee too"
You know, at least I think China is a bit more honest about how they approach this question.
It could totally be a slippery slope towards the government amassing more power and then granting contracts only to those who parrot the party line, but I believe the solution to that is to reduce government size and power.
And also, I don't find your position so controversial that you'd need a throwaway account.
I think there's a stronger case that your purchase choice is covered as free expression or that the government can't compel you to do business with a private entity.
But that is exactly what boycotts are all about. An effective boycott isn't just you deciding to stop buying something, but it's about convincing lots of other people and organizations to also stop buying something.
And, perhaps most importantly, in any organization there is guaranteed to be a paper trail for any prohibitions against, say, purchasing from any companies in Israel. This kind of legislation absolutely would have a chilling effect on organizational purchases, which is where the vast amount of money sent to places likely to be boycotted comes from.
Legislators who propose and pass this legislation use it to demonstrate their support for Israel, or coal mining, or gun rights, or whatever anti-boycotting cause they're advancing.
Entities who are forced to sign these pledges generally put as much thought into it as you or I put into agreeing to a TOS with a binding arbitration agreement. In other words, not very much thought at all.
Because ... As you've pointed out, the government cannot, in practice, prove that those entities are actually boycotting unless the entities come right out and say it. So if the entities actually want to boycott Israel, they can continue to do so without announcing it. The law doesn't actually stop anyone from boycotting Israel; at best, it merely stops them from publicizing what they're doing.