Professional football restricts player transfers to defined periods rather than allowing them at any time. The rule exists to protect the meaning of results already played.
A league table compares different opponents
Every team plays a different sequence of fixtures, and a result is only comparable if the opponent faced in September resembles the one faced in April.
Unrestricted trading would allow a squad to change substantially between those meetings, so points won early would reflect a team that no longer exists.
Closing the market for most of the season keeps squads broadly stable across the period in which results accumulate.
The window prevents strategic rescue
Without a deadline, a club with money could respond to a poor start by rebuilding continuously, and a club facing relegation could do so at the very end.
Competitors who played that team earlier would effectively have faced a different side from the one their rivals face later, which distorts the whole table.
The mid-season window is deliberately short and falls at a point where enough fixtures remain for any changes to be tested properly.
Contracts need a fixed horizon
Player contracts run to defined dates, and a club plans wages, squad numbers and registration against a season it can see the shape of.
A permanently open market would leave every squad provisional, and no club could commit to a season's budget without knowing whether its players would still be there.
Registration deadlines complement the window, so a signing completed late may still be ineligible for particular competitions.
The deadline concentrates the activity
Because a closing date is fixed and known, both sides of a negotiation gain from waiting, since the party under time pressure is the one that concedes.
Selling clubs hold out for better terms while buyers hope a price will fall, and a great many deals are consequently completed in the final hours.
Chains form as well, since one club cannot sell until it has secured a replacement, and a single collapse can unwind several transactions at once.
Why exceptions exist
Emergency provisions in some competitions allow a replacement goalkeeper to be signed outside the window, because a squad cannot field a team without one.
Players who are out of contract are generally not restricted by the window at all, since no transfer between clubs is taking place.
Windows differ between countries and confederations as well, which is why a player can sometimes leave for a league whose market is still open after his own has shut.