I've never heard the reason for it. Usually the locomotives provide HEP, but not always. A few trains a year seem to end up using freight locomotives for power, and it's useful then.
The Series 8 sets have a generator in the cab car, too. Just how Talgo does things.