Summary: Twitter's board had good reason not to let Musk do this, and had tools to prevent him from doing it.
The board of a corporation has a fiduciary duty to preserve the value of all shareholders, and not just 51% of the shareholders. To your question, it would have been possible for the board to let Elon Musk acquire a controlling (51%) interest in Twitter stock, by buying that stock on the open market, but that leaves the 49% of remaining stockholders with a rather unequal result of now having stock with no voting power, but not receiving any compensation (since they didn't sell). Maybe that's fair, maybe it's not, but it's the kind of thing likely to land the current board in a bunch of lawsuits which they don't want.
Instead, the outcome the Board wants is for Musk to make a "tender offer", where he agrees to buy all the stock, not just 51%, at a fixed price (which is what actually happened). This satisfies their fiduciary duty to all shareholders, since all shares are equally treated.
It's worth noting that the board took concrete actions to make Musk make a tender offer (as opposed to buying his way to 51% on the market). At the point at which Musk disclosed his initial 9% stake, the board introduced a "poison pill", which is a mechanism where if Musk (or anybody, but nobody else was trying) acquired more than x% of the stock, that shareholder's stock would become diluted (by giving all other shareholders a dividend creating new previously unissued shares). The board later retracted this poison pill once Musk began making his tender offer, having served its purpose.
Back to fiduciary duty, it seems like the poison pill clearly violates equal treatment of shareholders, because they're diluting a single shareholder's shares. However, US courts (specifically Delaware courts) have consistently upheld poison pills, because it protects the wider fiduciary duty to not allow 49% of shareholders to get screwed in acquisitions.