The episode "Out of Gas" tells of the recruitment of Serenity's crew via a series of flashbacks. Kaylee's roundabout route is shown;
The next two to join the crew are Hoban Washburne, an accomplished pilot who bothers Zoe for some unexplained reason, and a laid-back mechanic named Bester. On a layover for repairs, Bester brings a young woman to the engine room for some sex; this woman, Kaylee Frye, soon replaces him as engineer when she shows an instinctive rapport with the ship's engines.
Given that Mal's "Hat" is basically loyalty to his crew, did I miss anything that would explain why he was so quick to drop Bester when Kaylee come along?