Two reasons: one is that removing the power source, which is the battery, cuts off the current that keeps the fan running. Two is that a simple series circuit only one path for the current to flow and any interruption along this path causes the fan to stop working.