You think Doflamingo would have beat prime Whitebeard?
Crocodile symbolizes a silver medalist who lost his ambition. He strived to become Pirate King and when he couldn't he lost his purpose and goal in life. He stopped believing in his own strength and his crew was lost.
He grew into a lonely depressed man who trusted no one. A man that hoped Pluton would grant him the strength he lacked but also to help him put up a barrier between himself and the world. Instead of facing strong foes he would build a sand fortress keeping strong enemies at bay with his sandstorms and with Pluton at the harbour.
Doflamingo on the other hand managed to keep his crew intact and had a real position in the pirating world thus feeling valued, cherished and important.
The beating by Luffy was the best thing that could happen to Crocodile. He saw the drive he once possessed and lost along the way. He saw the companionship of the mugiwaras. So Crocodile started to trust Mr 1, clearly evidenced by him putting his life at risk against Mihawk for the sake of his nakama. He ventured into the new world again. He became a broker.
With renewed resolve he forged a pirating life backed by somebody who respects him. Full power Crocodile is definitely yonko commander level with his haki back and some new tricks up his sleeve.