TL;DR: it was done as keeping-up-appearances measure for peace treaty between France and Austria.
Well, personal likes and dislikes have really little to do with anything then talking about royal marriages (at least back then).
Marriage between Louis XV and Maria Leczinska was probably one of the most marriage decisions (politically-wise) in the history of House Bourbon. At the age of 15, Louis XV fell ill and as his then fiancee was 10 years his junior, French government was afraid that king can die without fathering a heir and begat to look for someone of more child barring age.
Pretty much every unmarried daughter of every ruler in Europe was considered, with Maria being at the end of the list, because her father was- by the standards of the proper royalty- a homeless beggar, Leczinski's had no real allies and influence to speak of and personal properties of Maria herself was... plain.
However, as the selection processes become a political thug-of-war between First Minister Duke of Bourbon and cardinal Fleury (who wanted to be First Minister) Maria eventually rose as a compromise candidate and was married to Louis XV in 1725.
Little of actual political benefit for France could be foreseen at the time, but then Elector of Saxony, King of Poland and Grand Duke of Lithuania Augustus II (the guy who kicked out Stanislaw from Poland-Lithuania) approached his deathbed, a question of a new elections was on the horizon. Austria, Russia and Prussia had an agreement to support neither Augustus II successor Augustus III, neither Stanislaw, but by the time Augustus II actually died, this agreement was dead, as Augustus III bought the support of Russia (by giving them Duchy of Courland) and Austria (by supporting new inheritance law called Pragmatic Sanction), leaving only Prussia to oppose him. It was mainly support (bribes) of France that led to Stanislaw being elected September 12 of 1733. However Russian army showed up and in October 5 another electoral Sejm voted for Augustus III and Stanislaw fled to Danzing were he tried to make a stand with the help of French detachment but after four moths of siege, city capitulated and Stanislaw forced to flee, leaving Saxon and Russian troops to deal with his remaining supporters.
However, events in Poland were of little concern to the main players in the War of Polish Succesion- Austria and France. These two were bumping in to each other in Italy since the 16th century and now Francis, duke of Lorraine, was engaged to Maria Theresa, heir-apparent to Emperor Charles. Meaning that duchy was bound to become part of Austria, something France could not allowed to happen. So, French main "support for Stanislaw" was to invade Lorraine, why Spain (France's ally) invaded Italy.
In most other cases, Stanislaw would had been dropped unceremoniously after he was of no more use for France, but because he was father-in-law to the king, simply abandoning him would mean losing points in political scene.
So, the war ended with:
a) Stanislaw losing in Poland
b) France controlling Lorraine
c) Spain controlling south Italy.
d) Austria holding out in north Italy.
Peace treaty in 1736 simply affirmed this development in period-appropriate fashion: Stanislaw renounced his claim on Poland-Lithuania and was given Lorraine as compensation, with condition that after his death duchy will pass to king of France as dowry for Maria Leczinska (as Stanislaw did not provided one in 1725). And Francis, as compensation for renouncing Lorraine was compensated with duchy in north Italy.
In the end everyone got to keep what they de facto controlled, claims that could spark another conflict were renounced and peace in Europe was secured for the whooping four years.
--
J. Feldman. Stanisław Leszczyński. Warszawa, 1959.
Rostworowski E. O polską koronę. Polityka Francji w latach 1725-1733. Wroclaw-Kraków, 1958.