Carbon dioxide is a gas at room temperature because its molecules have enough thermal energy at room temperature that they won't stick together. Heat (or lack of it) is what drives change of state.
Carbon is an solid at room temperature, it normally occurs either in the form of graphite or diamonds. It has the highest melting point of any element: 3823 K (3550°C or 6422°F), boiling at 4098 K...
The boiling point of water is 100* Celsius which is far more than room temperature which is nearly 30* Celsius while carbon di oxide has a boiling point of -57* Celsius which is very less than that...
Because the room temperature is way above its boiling point -57 °C (at 5.185 bar) It also has to do with the fact that carbon is a non-polar molecule meaning the atoms in the molecule are shared...