Um, no? If the cops arrest you, they do not have the right to ransack your house.
They can search you and your car. As I understand it, the original idea was simply to ensure that you weren't armed and weren't carrying anything that they didn't want you to have while in jail. Creeping decisions by the courts have broadened this beyond recognition.
Allowing them to search your phone is much more like your house: This has nothing to do with officer safety. They may not want you to have the phone while in jail, so they can confiscate it. However, looking around in your files and messages is like going to your home and rummaging through your personal papers. So far, that *does* require a warrant. Granted, it's an easy warrant to get if you've been arrested.
Then they went the next step: using this guy's phone to set a trap for someone else. IANAL, but this sounds an awful lot like entrapment.
The police want to nail the bad guys. They will use whatever means they can get away with, because their cause is just and their hearts are pure. Mostly, the courts go along with them, because they are all players on the same team. This is all great, until you consider what happens when an innocent citizen falls under suspicion.
If the cops and prosecutors think you are guilty of some crime, they will use whatever means they have to nail you. Then they pile on the charges to intimidate you into accepting a plea bargain, so they can go on to the next case without the trouble of providing any due process. That pic of your kids in the bath? Child porn. That joking message to your friend? Conspiracy. Ridiculous, sure, but do you have the money to defend yourself?
It must be our goal as citizens to keep the system under control.