Yes it is, passports and boarding cards an be swapped and people can board a plane they are not supposed to be on. You dont realise how important it is to ceck this. In the airport i work in the airport authority regularly send people on flights who have to swap boarding cards or passports to see if staff are checking them. If those undercover pax get through the gate that staff member WILL be fired.
So yes it is neccessary for security to check a passport at the gate along with the boarding card.