Not only in terms of power level, its also in terms of story so Oda has a soft spot for Heart Pirates;
1- Only Law's no.2 Bepo gets an equally big panel as Zolo, while not even Ray, Sabo, Beckman, Marco, others are all shown in equally same size panels:
This doesn't show superior power over other no. 2 just that shows Bepo and Zolo are Oda's favorites over other no. 2 characters.
2- Law has an extensive story related flashback during Dressrosa arc, while Kid doesn't get that.
3- Law is a D.
4- Oda didn't highlight where Heart Pirates are strongest until they fought BB Pirates, they are stronger in sea battle.
5- Oda gave a power up to Bepo via Strawhat Pirates Chopper, the connection between the 2 Pirate crews are clear, its not remotely close with Kid Pirates.
6- Bepo was shown in Law's bounty poster, similar to Usopp was shown in Luffy's bounty poster.
7- Law saved Luffy's life 2 years ago.
8- Law is smarter as he wasn't captured by Kaido unlike Luffy and Kid, he doesn't directly attack like Kid and doesn't make himself an open target, which is much difficult to deal with.
Heart Pirates are like a reflection of SH Pirates, and Oda choosing them to lose vs BB Pirates is bigger than Kid Pirates losing.
There are also power level related reasons as BM mentioned Law's attack is stronger or Law showing advance Haki, and they are being stronger on the sea with their submarine that can dodge attacks from 2 Admirals, but power levels are not the main topic here.
1- Only Law's no.2 Bepo gets an equally big panel as Zolo, while not even Ray, Sabo, Beckman, Marco, others are all shown in equally same size panels:

This doesn't show superior power over other no. 2 just that shows Bepo and Zolo are Oda's favorites over other no. 2 characters.
2- Law has an extensive story related flashback during Dressrosa arc, while Kid doesn't get that.
3- Law is a D.
4- Oda didn't highlight where Heart Pirates are strongest until they fought BB Pirates, they are stronger in sea battle.
5- Oda gave a power up to Bepo via Strawhat Pirates Chopper, the connection between the 2 Pirate crews are clear, its not remotely close with Kid Pirates.
6- Bepo was shown in Law's bounty poster, similar to Usopp was shown in Luffy's bounty poster.

7- Law saved Luffy's life 2 years ago.
8- Law is smarter as he wasn't captured by Kaido unlike Luffy and Kid, he doesn't directly attack like Kid and doesn't make himself an open target, which is much difficult to deal with.
Heart Pirates are like a reflection of SH Pirates, and Oda choosing them to lose vs BB Pirates is bigger than Kid Pirates losing.
There are also power level related reasons as BM mentioned Law's attack is stronger or Law showing advance Haki, and they are being stronger on the sea with their submarine that can dodge attacks from 2 Admirals, but power levels are not the main topic here.