The marriages of the Prophets are never for sexual desires but for purpose of serving the message of Allah (SWT) including avoiding expected bigger harm on the message and testing the degree of the faith of the people especially after the Prophet's life. Prophet Noah and Prophet Lut got married with wives who were away from obeying Allah and obeying them as Allah has mentioned them in Quran as the example of non believers (Sura 66, verse 10) despite being wives of prophets. This confirms that the degree of a person is not by relation but by sincere faith and obedience to Allah and His messenger. The marriage of the Prophet (SAWA) with Aisha was because of the demand of Abu Bakr , her father, likewise the marriage with Hafsa was by a demand from her father Umar. The Prophet (SAWA) wanted to avoid the harm which can happen to the newly established Muslim society in Madinah.
The very important aim of distinguishing between real believer and superficial one, was achieved when Aisha stood and fought against Imam Ali (AS) the real successor of the Prophet (SAWA) and she was followed by those Muslims who were not concrete in their faith. Wife of Prophet Musa (AS) did similar when she led an army to fight against the successor of Musa. History repeats itself.
'Such persons attract those who carry the name and claim but don't really follow the teachings of the Prophet. Allah says in Quran: Allah will never leave the believers in the state in which you are now until He distinguishes the wicked from the good. (Sura 3, verse 179).