Because it helps morale and sets marching pace. When they suddenly didn't have people marching in lines, they mostly got rid of the pipers, and they never used such people for skirmishes, which is what D&D is about. And those people were NPCs with a few ranks in Perform, not PC class heroes...