The importance of the media in a democratic country is to inform people about the events and the actions of people in an impartial way.
So, in the case of elections, while the candidate would want to present themselves in the most favourable light possible, it is the role of the media to check if the candidate is not bending the truth and for example violating the rules he or she is advocating for.