Why is pyridine used when making tosyl esters from alcohols?
The function of pyridine is actually not so simple and not so easy to notice at first glance. There is a fundamental reason why pyridine is used to promote the acylation reaction, which is that it can act as a catalyst.

Despite its basicity and the subsequent formation of its chlorhydrate salt after the tosylation reaction, pyridine is also an excellent nucleophile. Pyridine is, in fact, more nucleophilic than the alcohol, and it attacks the acyl chloride rapidly, forming a highly electrophilic (because of the positive charge) intermediate: N-tosylpyridinium chloride. It is indeed this intermediate the actual tosylating agent which reacts with the alcohol to give the ester. Because pyridine is acting as a nucleophile to speed up the reaction, yet is unchanged by the reaction, it is a "nucleophilic" catalyst.