Although that's not really a downside of CarPlay itself, and you can also solve that with the Optimized Battery Charging feature, in iOS 13 or later. So just turn that on.
I have it turned on and it helps when charging during the night. It will charge until 80% and then charge until 100% for just in time when it thinks I need it.
But then when I get in my car it will just stay charged at 100% all the time.