I've read many comments suggesting that there is no cost to the airline if the passenger doesn't take the last leg of the journey, but I think it's possible there is a cost.
(I'm making a few assumptions here, most of which I think are likely/valid but if anyone can disprove this I'm open to learning something new!)
So, we have a passenger flying from A to C with a stopover at B (ie route A=>B=>C). Let's assume A/B/C are in mutually exclusive countries (as they are in this specific example). When you arrive in a different country to the one you departed, you pass through customs/immigration at the airport, unless you're transiting through (which in this case the passenger was supposed to do.) As I understand, the staff who run the customs/immigration checkpoints usually work for the government, not the airports themselves and hence I would expect the government charges the airport for the cost of those staff and hence also then the airport passes on a charge (per passenger) to each airline to process those passengers, which are built into the cost of the ticket.
So, in this case the airline expected the passenger to transit through B and pass through customs/immigration at C and hence paid a fee in advance to airport C to process this passenger. However, the passenger skipped the final flight and passed through customs/immigration at B instead. I would expect that airport B can determine from the passport number (which would be scanned at immigration) which airline (and flight) the passenger flew in on (airlines must submit full passenger manifests, even for passengers transiting through an airport) so airport B knows which airline to charge for processing this passenger. It's possible they may even charge the airline a penalty rate for not pre-paying for the processing of this passenger.
So, now the airline has paid both airports B and C to process the passenger through customs/immigration. You can argue that the airline saved money on fuel by not having the passenger on board the final flight, but who is to say that the amount saved is more than the additional processing cost paid to airport B?