Where does the unit kelvin come from? The zeroth law of thermodynamics implies, that there exists a function of state variables $\theta(U,X_i)$ such that when two systems are in contact with each other, their thetas are equal$$
\theta_1(U_1,X_{1,i}) = \theta_1(U_2,X_{2,i}),
$$
and you can associate $\theta$ with thermodynamical temperature $T$. Why isn't then $$[T] = [U^\alpha]\cdot\prod_n[X_n^{\beta_n}] = \mathrm{J^\alpha\cdot\prod_n[X_n]^{\beta_n}}?$$
In other words, why does kelvin get to be its own SI unit?
Moreover, each degree kelvin is associated via the Boltzmann constant $k_B$ with some (~mean) energy of the particles. Why aren't we just using that and have the kelvin as a derived unit used to avoid confusion, just like we use hertz, bequerel and s$^{-1}$?
 A: 
Why does kelvin get to be its own SI unit?

As of right now: because of historical reasons. The SI was redefined in 2019 (see also this larger thread), and this included a redefinition of the kelvin, whose definition now goes through an exact value of the Boltzmann constant $k_B$. This means that the relationship between the kelvin and the joule is identical to that between the meter and the second.
The concept of a base unit had become slightly shaky over the years, starting to the redefinition of the meter to $c$ times $1\:\rm s$ in 1983: while originally it was extremely important as a tool for metrological tracing of chains of calibration (which originally terminated at the implementations of the base units), by now it is only retained for historical continuity, i.e., because we used to have "base units" and it would break too many things to get rid of them. (For a similar take on this, regarding the ampere, see this previous question.)
In that regard, it would be perfectly reasonable to, as you propose, treat the kelvin as a derived unit. But because of the rest of the package of the SI redefinition, you get the same for the ampere and the kilogram -- it would be much more accurate to say that the volt and the ohm are more "fundamental" due to the way the standards are implemented (as explained here). So, unless you're willing to go that far, it's better to leave the set of base units as it is.
That, said, of course, if the answer is "because of historical reasons", then we also need to discuss what those historical reasons actually are.
So: up until 2018: because the kelvin was metrologically independent. The framework of statistical mechanics is sufficiently strong that it leaves no room for doubt that, as far as the abstract concepts go, temperature is directly proportional to energy through a fixed, universal constant (the Boltzmann constant), and, as such, it is not really an independent physical dimension. However, the fact that they're equivalent in the theory doesn't mean that this can be reliably implemented in the laboratory to high precision.
Until a few years ago, there was simply no way to build a thermometer that achieved competitive precision and which was based on a statistical-mechanical system which was completely understood. This concept is (now) called a "primary thermometer", and it is what allows us to use $k_B$ as the standard, i.e., what allows us to actually make the kelvin a subsidiary unit to the joule in practical metrology. The development of high-precision primary thermometers (for a small slice of the temperature spectrum!) is what allowed the 2019 redefinition to go ahead.
Without precision primary thermometers, what we have is a bunch of high-precision methods for thermometry, but no way to calibrate them against a fixed value of $k_B$, so we needed something else to use for calibration. This is where the (old) SI kelvin comes from, defined independently using the triple point of water, and forming its own island in the dependency chart of the (old) base units.
A: Because I do not have enough reputation points to add a comment, I have replied using an "Answer".
Consider Lecture 2 of MIT thermodynamic course 5.60 [https://www.youtube.com/watch?v=TDqx8Zv1rRo]
The Kelvin unit was formed due to the inconsistent reference points of the Fahrenheit and Celsius temperature scales. After the discovery of the ideal gas relationship, it was instead suggested to use the limit of the Ideal gas law as pressure approaches zero, which would act as a consistent, but hypothetical reference point for temperature.
In short, I believe it is due to the historical aspect of temperature scales. The Kelvin scale was developed before stat-mech.
