I know that passwords are not stored in plain text (or at least, that they shouldn't...), but can you still compare their hashes to know if 2 users have the same password?
If you're using salted hashes, then no, you can't, as the salt will be different for each user.
And if you're not using salted hashes, start using salted hashes.
Unique passwords are the whole point of salting. You salt so that there won't be a bunch of users with the same hashed password; forcing users to pick passwords with a high degree of uniqueness would accomplish the same thing.
...I think salted passwords are still the way to go, and I can't think of any practical way to implement it without using unsalted passwords, so I dunno. It probably wouldn't be worthwhile. Definitely not just as a method to identify potential bot/spam accounts...