That's not what it says at all.
It says:
But the fruit of the Spirit is love, joy, peace, longsuffering, kindness, goodness, faithfulness, gentleness, self-control. Against such there is no law.
https://www.biblegateway.com/passage/?search=Galatians5:22-23&version=NKJV
There is no law...