The £28m Drax will be made to pay is the largest ever fine handed down by Ofgem. Intergen, meanwhile, will pay a more muted £11m.
Ofgem said the two companies had failed to meet targets under the Community Energy Saving Programme (CESP), designed to help reduce energy bills, which gave energy companies targets to insulate homes.
Sarah Harrison, a senior partner in charge of enforcement at Ofgem, said Drax had missed its target by a "clear margin, disadvantaging several thousand households in some of the most deprived areas of Britain".
But Drax chief executive Dorothy Thompson said the company takes its statutory obligations "very seriously".
We are deeply disappointed with the magnitude of the fine. However, we believe it is in our shareholders' interests to settle this matter and, as the nation's single largest power provider, focus on delivering a reliable supply of electricity this winter.