Chi-squared confidence interval for variance When constructing, for example, a $90\%$ confidence interval for the population variance using the chi-squared distribution, we have:
\begin{align}
& P\left(a<\frac{(n-1)S^2}{\sigma^2}<b\right) \\
= {} & P\left(\frac{\sum(\bar{X}-X_i)^2}{b}<\sigma^2<\frac{\sum(\bar{X}-X_i)^2}{a}\right)=0.9, \\ & \text{ where } \frac{(n-1)S^2}{\sigma^2}\sim\chi_{n-1}^2.
\end{align}
In my course, we then find $a, b$ such that $$P(\chi_{n-1}^{2}<a)=P(\chi_{n-1}^{2}>b)=0.05.$$
My question is, given that the chi-squared distribution is asymmetric for small $n,$ why do we pick $0.05$ for both sides? Surely we’d have a shorter confidence interval if we weighted more of the $0.1$ probability to one of the sides, instead of splitting equally?

For univariate continuous asymmetric distributions the highest density region (HDR) can be found by solving a constrained optimisation problem for the boundary points.  You are correct that this involves placing non-equal weight in the tails.  You can find a detailed analysis of this problem in O'Neill (2021), including a statement of the optimisation problem at issue and its solution.  This paper also goes through the problem of finding the optimal confidence interval for the variance.
To save you from reinventing the wheel, it is worth noting that HDRs for all standard univariate distributions are available in the stat.extend package in R.  The available families include the chi-squared distribution, the gamma distribution, and the inverse gamma distribution.  These can be used to manually compute the optimal confidence interval.  Alternatively, there are also direct functions for optimal confidence intervals, including the optimal confidence interval for the variance.  In the code below we use the CONF.var function to compute the optimal 95% confidence interval for some mock data.
#Load library
library(stat.extend)

#Create some mock data (same data as used by BruceET)
set.seed(2022)
x = rnorm(20, 50, 5)

#Compute optimal confidence interval
#Assumes a mesokurtic distribution (kurt = 3)
CONF.var(x, alpha = 0.05, kurt = 3)

        Confidence Interval (CI) 
 
95.00% CI for variance parameter for infinite population 
Interval uses 20 data points from data x with sample variance = 25.0148 and 
assumed kurtosis = 3.0000 
Computed using nlm optimisation with 8 iterations (code = 1) 

[12.4006846357447, 48.0126609150707]

