Unfortunately according to the federal government you automatically consent to limited 4th amendment protections when you choose to fly. Domestic flights have more legal protections, but international flights basically wave your right to privacy.
They are allowed to ask for your phone's password and do a "non-forensic" search of your phone for just about any reason. A more extensive "forensic" search where they plug your phone into another device can be made if they present reasonable suspicion. If you refuse a search they can hold onto your phone for several weeks.
The smarter move would have been to just refuse to give the password and trust that they wont want to go through the hassle of cracking your phone once it's in custody.
Basically the only real way to protect yourself is to not keep any incriminating information on your phone. The courts have ruled that these searches only extend to data that can be physically accessed on your device and things like social media and cloud storage are not subject to the search. So it's just best to save everything on the cloud and then restore it once you are done traveling.
You guys are looking at the wrong thing. Airports have their own set of bullshit rules. According to the government choosing to fly automatically implies consent to be searched. Domestic flights have more protections, but international flights basically wave your right to privacy under the 4th.
They only require explicit consent or probable cause if they want to do an advanced or forensic search of your phone. You can deny the search if you're a citizen, but if you choose that option they can take your phone into custody for several weeks to attempt to crack it if they choose to do so.