Boarding a ship, boarding a train, boarding a plane, etc. They all mean "getting on" something. Pirates do indeed board ships, but they do it without an invitation 
The phrase "Captain! We're being boarded!" simply means "Captain! People are getting on the ship!". In the middle of the ocean, people getting on the ship shouldn't happen, ergo being boarded in the middle of the ocean isn't a good thing

The phrase "Captain! We're being boarded!" simply means "Captain! People are getting on the ship!". In the middle of the ocean, people getting on the ship shouldn't happen, ergo being boarded in the middle of the ocean isn't a good thing
