Media tycoon Richard Desmond's company has been ordered to pay over £40m after a two-year long legal feud with the Gambling Commission over the Lottery license.