That was not very courteous, but visa stamps covering each other is not illegal and certainly won't make the passport invalid. Some overlap is actually pretty common:
It is a common courtesy to place visa and stamps on a blank spot/page but not a requirement. Visa that get covered by other stamps and stickers may lose their validity when they can no longer be read by immigration officials though. If the Chinese visa was still valid it might now need replacement before a future trip to China.
In general immigration officials will place visa, entry and exit stamps in such a way that their entries will be readable. That readability requirement is also the reason that some countries require an blank page as one of the conditions to award you a visa in the first place. (And that is also why it recommended to consider replacing a passport when you start to run out of blank pages.) Usually that means they won't cover (much) of entries made by other countries.
Visa printed on adhesive stickers won't suffer from reduced readability when they are placed over existing visa and stamps, but they will certainly make it nigh impossible to read those they cover.