If a server does something awful like encouraging spam or allowing abuse or whatever, admins of other servers can block it, which is also known as “defederation”. The worse a server behaves, the more other server admins will block it, and the very worst-behaved servers will find themselves almost completely isolated from the network.
For example, in 2019 a notorious neo-Nazi group attempted to join the Fediverse, but so many other servers pre-emptively blocked them that the group gave up and abandoned its plans to federate. There was even one third party app which rickrolled anyone who attempted to use it to log onto the neo-Nazi server.