By backing Haftar, Russia gets control of some of Libya’s best oil fields. The cost of Russia’s intervention with mercenaries is thereby defrayed, with plenty left over for profit, bribery, and kickbacks to Putin and his cronies. The blatantly transactional nature of much of Russian foreign policy may be squalid but it is often effective.
That may be it. It also may be a way of cutting off Libyan oil production through continued mayhem in the country, keeping it off the market, to shore up the price of its own oil. That's more likely. The added kicker is to oppose Turkey to keep it isolated from its neighbors.