The difficulty adjustment interval of two weeks, or specifically every 2016 blocks, was chosen to balance the need for stability and responsiveness in the Bitcoin network. This timeframe allows the network to adjust to changes in the total hashing power while not being so frequent that it causes instability due to rapid fluctuations in difficulty.
The two-week period is a compromise that allows the network to absorb variations in the hash rate without being overly sensitive to short-term spikes or drops. If the difficulty adjusted more frequently, it could lead to unstable block times in response to temporary changes in network hash power. Conversely, if the adjustment period were much longer, the network could fail to respond adequately to significant increases or decreases in hash power, leading to either very slow or very fast block times.
The specific number of blocks (2016) was likely chosen because it is the product of the target block time (10 minutes) and the number of blocks expected to be found in two weeks (6 blocks per hour * 24 hours per day * 14 days = 2016 blocks). This ensures that the actual block time averages to the 10-minute target over the difficulty period.