At the beginning of the affair it is singularly political in nature; a union of the state and nothing more. Being the foreigner on foreign soil Anthony needed to establish his legitimacy in the area. Since Octavian was Caesar's legal heir, Anthony had to not only dominate the area, but score a major military victory to rival Caesar's. The only place available for such a score was Egypt and Cleopatra stood in the way of that conquest.
On Cleopatra's behalf, of course, was a decent amount of guile. She had been Caesar's lover and the mother of a child by him. Cleopatra was only too willing to go along with Anthony's plans until such a time as she could declare her own son the ruler. Ever the shewed planner she knew Anthony's weakness for pomp and circumstance and she exploited this and his need for recognition. In exchange for her allegience he had to sign over large tracts of land to her for her son. And Anthony agreed.