Okay ,
1. The appanage system.
During the Medieval times, land was a the principal source of income. The objective of appanages was to give land (thus income) to the cadet sons, so they could a have revenue and not mess up with the crown. It was a sort of pill given to the younger sons of the King in order to sweeten primogeniture (since they didn't inherit the crown) and to prevent the revolt of younger sons.
2. How this could be avoided ?
Very difficult to say. The system disappeared with the affirmation of nations states (thus royal power) during the XVI century. But after Charles V of France a clear distinction was made between courtesy title and true appanages see:
http://en.wikipedia.org/wiki/Louis,_Dauphin_of_France,_Duke_of_Burgundy
The first king who tried it was Charles V of France after he saw that his father John II of France had used this politics too extensively (just look at at Charles'brothers, they were powerful just as him and will control the country's politics after his death). As I said, to limit the appanage system, you will need in my opinion a increase of royal powers and an alternative system for cadet sons.
3.Elsewhere in Europe
English monarchs regularly employed the same method which was brought with Norman and Plantagenet kings. Look at the sons of Edward III ( that is when the eponymous duchies of York and Lancaster appeared). Today, the duchy of Cornwall is the permanent appanage of the Prince of Wales ( with all the revenues), other family titles aren't attached to any revenues and are honorific.
In Scotland, the duchy of Rothesay is a remnant of this period.
In the Kingdom of Jerusalem, the County of Jaffa and Ascalon was given many times as an appanage (see, the French even brought this system in the near East).
In Eastern Europe too, there was I think a same system. But as primogeniture began to be adopted by nearly all Europe's realms, the need to give younger sons land was felt.
4. Of saint Louis and his father
I don't believe they could do anything about that. The appanage system was some kind of tradition dating back the division of the kingdom among all sons under the Merovingian.So I don't they will act against it and face a revolt of their younger sons allied with the barons of the realm.
5. Laws about appanages :
There was a Act of the Parlement de Paris of 1283 on the occasion of the death of Alphonse de Poitiers ,which stated that appanages given by King will come back into its fold at the extinction of the direct line.
However , it seems the rule didn't apply to appanages created before Philippe le Bel (see Mahaut d'Artois,Louis de la Male, who inherited Artois by the right of his mother). After Phillippe le bel, women can no longer inherit appanages but the rule wasn't apply right away.
There is also the famous case of Burgundy, who first an ancient (a the time where women still inherited them) appanage. After the death of Charles the Bold, lawyers still debated if Burgundy was really an appanage or not and if it could reverted to the Crown. For more info go to this wiki (although it is in French) :
http://fr.wikipedia.org/wiki/Apanage#Le_cas_bourguignon
As you can see the laws of inheritance varied over time so it all depends of your POD ( during the golden age of chivalry aka St-Louis'reign, after Philippe le Bel, during the HYW etc.) You should also see the Edict of Moulins although it's a bit late (1566).
Also, with the rise of royal power (Phillipe le Bel ) , the first laws about appanges were made which kind of validates my point of view in which reducing appanages = increasing King's powers.
Interesting fact : the last feudal appanage in France the duchy of Bourbon which was integrated into the royal demesne in 1523.
PS: If you have any questions or other things please feel free to send me a personal message