There is nothing stopping you from writing good code when doing competitive programming.
but I feel when we do competitive programming we mostly look for shortcuts to do it fast and not always the good approach to do it though I myself I have little experience in competitive programming.