A theoretical temperature function $T$ must at least meet the following two criteria:
1) Two systems that are internally in thermal equilibrium and are suddenly brought into thermal contact with each-other (though not in mechanical contact) show no heat-transfer iff they share the same temperature. If a energy or heat-transfer does take place, it is from the system with the higher temperature to the lower temperature. Suppose then that system $A$ and $B$ share the same temperature and $B$ and $C$ share the same temperature (in other words: bringing $A$ and $B$ into thermal contact doesn't yield a heat-current and neither does bringing $B$ and $C$ into contact), then $T_A=T_B=T_C$: $A$ and $C$ also have the same temperature. So "having the same temperature" is a transitive and reflexive relation and therefore an equivalence relation (0'th law of thermodynamics) among systems that are internally in thermal equilibrium.
2) Temperature should be an integrating factor for the heat 'vectorfield': recall that the first law of thermodynamics reads $dU = \delta Q + \delta W$ where $U$ is a system's internal energy. This first law is shorthand for a decomposition of the gradient of the function $U$, whose independent variables are a finite number of pairs of thermodynamic potentials, with the first member of each pair having an extensive nature (volume, charge, magnetisation,...) while the second member of each pair has an intensive nature (external pressure, external electric potential, external magnetic field,...): $\{V_j,p_j\}_{1\leq j\leq n}$. Let me stress however that temperature and entropy are not among these variables: the variables $\{V_j,p_j\}_{1\leq j\leq n}$ have an unambiguous pre-thermodynamic 'mechanistic' interpretation. In any case, the work-differential $\delta w$ equals $-\sum_{j=1}^n p_jdV_j$. Rewritting this in perhaps more familiar calculus notation, this means $\vec{w}(V_1,p_1,...,V_n,p_n)=-\sum_{j=1}^np_j\vec{e}_{V_j}$. In any case, $T$ is desired to fulfill the role of integrating factor for that other term, $\delta Q \leftrightarrow \vec{Q}$, so that the 1st law acquires the form
$$\nabla U = \vec{Q}+\vec{w}=T\nabla S -\sum_{j=1}^n p_j \vec{e}_{V_j}$$
where the function $S(V_1,p_1,...,V_n,p_n)$ is called the system's entropy.
If $\vec{w}$ is of the stated form, then its curl is non-zero for every $(V_1,p_1,...,V_n,p_n)$. Taking the curl of the first law (i.e. $\nabla U = \vec{Q}+\vec{w}$), then yields the conclusion that the curl of the heat-vectorfield $\vec{Q}$ (i.e. the heat conceived as a vectorfield over the variables $\{V_j,p_j\}_j$) also vanishes nowhere.
Now comes a positive surprise: if $T$ is an integrating factor for such a "everywhere-rotational" vectorfield $\vec{Q}$ and suppose that $T'$ is another integrating factor (for the same vectorfield $\vec{Q}$), i.e. $T\nabla S = \vec{Q}=T'\nabla S'$ and if we demand that the functions $T$ and $T'$ share the same contours (in order to respect the zeroth law, which we discussed earlier), then one can show that there is a constant $\lambda>0$ s.t.
$$T'=\lambda T$$
Our two requirements have fixed a temperature scale that is unique up to linear rescaling/linear recalibration.
I believe this argument and reasoning can ultimately be traced back to Carathéodory's 1909 seminal work but I'm not 100% sure whether that is correct and/or a complete historical account.