This form of eavesdropping became common practice with rulers from many cultures. In English, the phrase "the walls have ears" was first recorded in its present form in the mid-1600s. (From "Shhh! The Walls Have Ears!")
Does it mean 'by'?
Another paraphrase of with in this context might be attending or accompanying.
A problem with|attending high-performance cars is that they need very frequent tune-ups.
A problem that accompanies high-performance cars is that they need very frequent tune-ups.
Much the same idea can be expressed with the possessive:
The problem with him is that he gives up too soon.
His problem is that he gives up too soon.
This form of eavesdropping was the common practice of rulers from many cultures.
It simply means 'among'.
Rulers from many cultures commonly practiced this form of eavesdropping.