The 'honest official' meaning comes from
包青天 (Bāo Qīngtiān) — Northern-Song judge
包拯 (999-1062), proverbial in folklore for incorruptibility. So
青天 = blue sky a good official is so transparent his rulings are 'clear as the blue sky'. Often expanded as
青天大老爷 ('honorable upright magistrate').