A Castleford scaffolder has been prosecuted after a worker fell to his death from a roof.