The reason for this is that the organisation of the U21 tournament was designed help the development of international teams. And UEFA decided that it would be unfair for players to feature in qualifying but be unable to take part in the Euros themselves because they've then gone past the 21-year-old threshold.
As long as they are eligible, players can play at any level, making it possible to play for the U21s, senior side and again for the U21s.