SPI CLK/MOSI and Noise
I found the fix for this.
In CubeMX (SPI configuration) there is an option called &quot;Master Keep IO State&quot;, by default it is disabled.
Enabling it fixed the floating levels of CLK/MOSI and the sensor is no longer getting triggered by randoms levels on CLK/MOSI.
I am now left with switching noise issues, which are beyond the scope of that question.
Hopefully this will help someone else.