How come the L298N fries my Rpi?
For L298N newbies, anything that can go wrong will go wrong. Let me list some of the things.
Part 1 - Connecting Rpi 3V3's GPIO pins, which are not 5V tolerant to the 5V test terminals of an L298N board which is designed for 5V Arduino whose GPIO pins welcome 5V.
Workaround - Do not use a L298N board with two row of jumpers, or if you have already wrongly bought one, use a cutter to remove the 5V jumper pins on the top row.
Part 2 - Does not first read the friendly user guide and schematic and start guessing and messing around with the wiring terminal and jumper, or as the OP suggests, adding unnecessary protective diodes in the wrong polarity or across the motor terminals, causing short circuits here and there.
Part 3 - The above schematic shows that there are two power sources:
(a) Vcc for powering the motors, can be 4.5V to 12V.
(b) Vss for powering the logic/control/H-bridge circuit, can be (i) externally provided, or (ii) from output of the on board M78M05 5V voltage regulator, with input from approx 7V to 12V. If M7805 input is higher than 12V, too much energy will be wasted a heat and might damaged the regulator. For more details, see Reference (1) below.
Part 4 - L298N Wiring, Testing, and Warning to newbies
Warning - There are two kinds of L298N boards, one with 5V In/Out terminal at the middle of the PCB, another with 5V near the mounting hole (one side of PCB), as shown below.
/ to continue, ...
(1) Interface L298N DC Motor Driver Module with Arduino - LastMinuteEngineers