it is hard to help without the deeper knowledge about schematic, but in general, digital outputs on CONTROLLINOs are for maximum current of 2A, so when you connect the motor directly, of course, outputs can be overloaded (30W/12V = 2,5A) and will not work (also respect to the motor startup current).
You are writing, that you are using L298N which is dual H bridge, but this H bridge has the similar limitation with DC operation of continues 2A. When you are using this bridge, from CONTROLLINO you shall use only digital signals from Pinheader – see the L298N datasheet. If you connected D0 to INPUT or ENABLE of the L298N it burned because on Dx outputs is the CONTROLLINO power voltage.
About the driving of the motors, you can think about the CONTROLLINO MEGA which has Half Bridge outputs already implemented (but also with 2,5A max. current) or you can use every Half or Full bridge IC or shield. Try to google it .
Could you please provide the schematic of your application to be possible to help more?