LM317 Constant Current vs Transistor Current Limiter
The LM317 adjusts the output current so that the voltage between the OUTPUT and ADJUST pins is 1.25 V. This reference voltage is compensated against temperature and current variations.

In the transistor circuit, the reference voltage is based on the voltage drop over the base/emitter junction of Q2. It's usually 0.65 V, but will change with temperature (you could use it as a temperature sensor). Futhermore, a plain transistor is not designed as a voltage reference, so different transistors will have manufacturing variations.

The LM317 is rated for 40 V; plain transistors are available with higher ratings, and are more robust in general.

To make the transistor circuit more stable, replace Q2 with a shunt voltage reference such as the widely-used and cheap TL431 (2.5 V) or TLV431 (1.25 V). It might be possible to create a stable voltage reference from discrete parts, but it is unlikely that that would be cheaper:


source: TL431 datasheet

Anyway, for driving LEDs, the increased stability might not matter.