Game companies often discontinue online features for older games after a while. This usually happens because they want customers to purchase a newer game or system, which were both the case when the 3DS and X/Y released.
Keeping online features running for old games requires additional servers, and costs companies more money than only having online for the latest games.