1) They lend the stock to shorters and make money off the interest.
2) They get people into their ecosystem. As most people don't keep a dozen different accounts, they can get people to start using their checking and savings accounts (where Fidelity makes money from lending a fraction of the balance). People might also be more likely to use their loan products, credit cards, or other services, which are obviously benefical to Fidelity.
There's likely other benefits to them as well, especially given that index funds don't require any real human oversight.
Edit: Given other info posted, it's really just #2. This is a loss leader to get customers.