White House showed ‘bad faith’ in global-warming case, judge rules