Traditionally, esterification reaction between acyl halides and alcohols (or phenols) to form esters are carried out in basic media.  This is primarily to neutralize the halogen acid (HCl, HF, HBr, etc.)  formed by the esterification, thus shifting the equilibrium in favor of the formation of the ester. 
In the case where it is desirable to prepare esters of amino alcohols, however, it has been necessary to substitute the amino moiety with an N-blocking group, such as acetyl, tosyl or tert-butyloxycarbonyl.  Otherwise the compound becomes acylated both at the hydroxyl and the amine groups.  Moreover where the compound is an enolic alcohol o-acylation is hampered by the keto form, and side reactions on the more nucleopholic functional groups are likely to occur.