It's just the luck of the draw. Empty seats on a flight are up for grabs once the door shuts. If you want an empty seat next to you then perhaps go for a window seat in a less attractive row.
I had a similar frustration on a BA flight from ALG-LHR. Found my F window seat occupied. The muppets in DEF had boarding passes for ABC. Meanwhile, D had shown up and decided to go to A. So the people who should have been in ABC decided to go to CDE, leaving the vacant seat at B that should have been next to me in E. That's life.