What's the purpose of these two diodes in this circuit?
This is a crude current source.

The two diodes are to create a voltage drop of approximately 1.4v, which is then applied across the transistor VBE and R21. This gives approximately 0.7v on R21, or 10mA through it.

Those two diodes could be replaced by a resistor to give the same voltage drop, but then if the supply voltage varied, the current would vary more or less proportionally. With diodes, the output current is substantially constant as the supply voltage varies.

It's only a crude current source as neither option with two diodes or a resistor gives you temperature compensation for the VBE of the transistor. Where this form of circuit is used as a current mirror, diode R18 is replaced with a resistor. The remaining diode R19 now compensates for the VBE and its temperature coefficient, and the voltage across the resistor R18 is now impressed on R21. For even closer compensation, diode R19 is often made from a 'diode connected transistor', and better yet, is a dual transistor with T1.