Only the form with the gerund (-ing form) is correct.
"It's not worth getting involved."
Practise with some more variations on this: It's not worth going there. That film's not worth seeing. It's not worth buying a return ticket. It's not worth looking in that shop.
The more you practise the correct form, the more correct it will seem, and the more incorrect the other one will seem. 'It's not worth to....... nah, that sounds wrong.'