I would say that electing the cabinet officials that you mentioned would not be a good idea. These secretaries must often be very specialized in whatever department that they oversee, and a political career may not lead to this knowledge.
For example, I would rather have nuclear physicist heading up the department of energy rather than a lifetime politician who simply knows how to get elected.
Furthermore, often times attorneys general have spent their entire careers in the court system, which prepares them for the position. If the attorney general had to be elected, these qualified legal minds might not have the political savvy to get elected, even though they probably deserve the position.