Enough of the large shareholders behind the scenes backed the deal for whatever reason. Who, what and why? We'll never get the real story. Not in any newspaper, blog or whatever. I'm sure we'll get some fanciful stories, but that's all it'll be. Fanciful stories.
The board of directors aren't the ones that have the final say. It's the major shareholders. Usually, the major shareholders back the board of directors because they are the ones who elect/hire the board of directors. Somehow, Elon and his backers convinced enough of the big boys to back him instead of the board of directors. Simple as that. Maybe he offered them free a roadster, starlink setup or a seat on a future spacex mission to mars. Who knows. But elon outmaneuvered the board of directors somehow.