By middle school, many kids’ interest in learning falls off a cliff. The ripple effects could last for years.