The root cause of this is that without a central authority, it's impossible to know for sure what the current time is.
The protocol rejects blocks with a timestamp earlier than the median of the timestamps from the previous 11 blocks or later than 2 hours after the current network time. Any other timestamp is acceptable. Note that 'network time' may differ from the actual time, since the bitcoin network attempts to correct for incorrect clock settings by taking the median of the time reported by all connected peers as the network time.
You can read about an attack that this makes possible here:
By announcing inaccurate timestamps when connecting to a node, an
attacker can alter a node's network time counter and deceive it into
accepting an alternate block chain. This could significantly increase
the chances of a successful double-spend, drain a node's computational
resources, or simply slow down the transaction confirmation rate.