If it weren't stored in the JS, the twitter bots could have just played the game quickly and found the answer. Making is slightly more annoying wouldn't deter them.
Don’t you think that a bot could not brute force everyday’s wordle every morning for a tiny amount of processing power? There are solving strategies out there that will solve it with a minimum amount of attempts. So all it would do is add a tiny delay to todays bot being a nuisance.
That’s still slightly different though. If the bots were just for today’s word, and I were the type of person who likes posting my streaks, I could realistically avoid checking twitter until I’ve solved today’s puzzle. If instead the bots are posting future solutions, it’s much harder to avoid having something spoiled.