Good question. There are certain professions, and really only a very few, that prepare one well for the task of campaigning for office. Lawyer, military officer, business executive, actor, a few others. All of them are from the professional class, nowadays, with the partial exception of military officer.
Once upon a time, a lot more power was held by local politicians, who were often from the working class. Over time, more and more of that became centralized, and the ability to speak well in public is not something that even most professional class jobs prepare you for. Put a programmer up against a lawyer or a CEO, and the programmer will not do well. We not only have mostly professional class politicians, they are overwhelmingly from only a few of those professions, because there are only a few that prepare you to speak, from a script, to a large group of strangers, staying on message and keeping your message short and clear.