For those who never "purchased" it, Apple provides a direct link to a disk image (.dmg) file via their support pages.

Apple hides older OS versions on the App Store, but they provide direct links on their support pages. The most reliable way to get a clean, safe copy of El Capitan is via the Apple Support article titled "How to upgrade to OS X El Capitan."