In a democracy one elects public servants based on how closely they and their party reflect your views. Once elected their duty to the public is to represent. Not to suddenly start expressing other contrary views. When they do so they no longer are serving the public who elected them but rather themselves. No one every got elected on a promise to serve themselves. Those who expose themselves as doing so after being elected should be removed from office.
Democracy is at the service of the electorate and by their choice. Hence the saying you get the government you deserve.