Ally or not, that is pretty much interference in the internal affairs of a sovereign nation.
We don't expect, nor would we tolerate, the US questioning our defense relationship with the Chinese, and on the flip side, the Chinese have stayed out of our defense dealings with the US.
Raising concerns privately with the Sri Lankans is a different matter, but the public statements amount to no less than an aggressive "big brother attitude" and interference.
This is not isolated to Sri Lanka either, the GoI made a big fuss about Pakistani arms sales to Vietnam as well.