XPeria L stuck in bootloop after flashing Ressurrection Remix ROM
I found out a way to do it. As pointed in the comments, I had to flash a new boot image, because for some reason on sony devices (not sure if on all of them) you can't flash a new recovery through fastboot.

So what I did was search for a new XPeria L boot image with twrp, which I found here:

http://forum.xda-developers.com/xperia-l/development/twrp-twrp-xperia-l-t2667370

I flashed it through fastboot and booted back to recovery, and then proceeded to restore the backup I made before trying to flash a custom rom. From there I flashed a new rom and now everything is working fine.