Impedance matching L Network
I‘m trying to understand exactly what an L-section Network does.

What you are describing in your question is a loss-less, high-pass, L-pad impedance matching circuit as per this example: -

The L-pad is used to match a lower impedance on the left with a higher impedance on the right. Either end can be source of course. In other words; you can match a higher source impedance to a lower load impedance or vice versa.
The formulas for L and C are dependant on the operating frequency of interest (\$\omega\$), the input impedance (\$R_{IN}\$) and the output impedance (\$R_L\$): -
$$C = \dfrac{1}{\omega\cdot R_{IN}}\cdot\sqrt{\dfrac{1}{\frac{R_L}{R_{IN}}+1}}$$
$$L = R_{IN}\cdot R_L\cdot C$$
Here you can find a calculator that saves you crunching the numbers by hand: -

That website also provides proofs for the formulas.

why the inductor(in my example, more specifically in a Highpass
Downward L-match) has to be a shunt inductor and the capacitor has to
be in series?

Well, you can make a low-pass version like this: -

Both work the same; at the frequency of interest, you can provide loss-less impedance matching as opposed to a wideband lossy impedance matcher like this: -


I understand it tries to eliminate the imaginary part of the impedance
and match the real part.

It provides loss-less impedance matching i.e. it makes the input impedance looks resistive and the output impedance looks resistive at the desired operating frequency. Either side of the mid-operating frequency, it's not quote perfect, but, it's good enough for most signals just like an antenna is not quite perfect either side of it's target mid-point frequency.