The relative stability of SiC polytypes, changing with temperature, has been considered a paradox for about thirty years, due to discrepancies between theory and experiments. Based on ab-initio calculations including van der Waals corrections, a temperature-dependent polytypic diagram consistent with the experimental observations is obtained. Results are easily interpreted based on the influence of the hexagonality on both cohesive energy and entropy. Temperature-dependent stability of stacking faults is also analyzed and found to be in agreement with experimental evidences. Our results suggest that lower temperatures during SiC crystal deposition are advantageous in order to reduce ubiquitous stacking faults in SiC-based power devices.