Is there any regulation (or self-regulation) that would force space explorers to create as little debris as possible? The Tesla roadster in space seems to be only a PR-gag.
Yes, there are regulations, they have all been observed.
SpaceX needed a boilerplate payload to showcase Falcon 9 Heavy. Something was going to go up there. So, the premise of your question is wrong, the payload was not completely useless - it actually did exactly what was needed.
Technically, they only needed to showcase F9H performance and upper-stage restart capabilities in order to get qualified for GSO operations, but SpaceX's long-term goal is to fly to Mars. So, they opted not only to showcase upper-stage restart capabilities, but decided to kill two birds with one stone and test how far they can get the boilerplate payload. If they did not do it this time, they would likely have needed another test flight with another boilerplate payload, producing twice as much debris.
Did it need to be the Tesla? No, definitely not. Not using a concrete block or whatever they would have otherwise used but the Tesla instead was just PR. But the PR part was only a minor part of it, the flight was an actual, needed test flight that provided lots of valuable data and showcased that the rocket is indeed operational as advertised. Without this test flight, it would have been much more difficult to get commercial customers.
Notably, the Tesla does not contribute to Kessler syndrome. It is off flying through the asteroid belt, getting almost to orbital height of Ceres. Space debris is only a problem in narrow spaces like LEO/MEO and, to a lesser extent, GSO.
SpaceX acquired all the necessary waivers and adhered to all regulations. They specifically thanked the FAA for their cooperation at the end of the launch stream.
A good summary can be found here (its from 2015, I do not believe much has changed since then, highlights are mine):
Commercial launches are regulated by the Federal Aviation Administration (FAA), which is charged with ensuring the protection of public health, safety, and property, as well as the national security and foreign policy interests of the United States through its commercial launch licensing process. These regulations apply to all commercial launch vehicle stages and their components through insertion of the payload(s) into orbit. FAA certification requires that an applicant demonstrate that the risk level associated with debris from a proposed launch meets the public risk criteria for unplanned explosions. Applicants must also show plans for keeping in contact with the payload after payload separation. FAA certification also depends on applicants’ plans for the mitigation of risks from reusable and reentering vehicles. However, the FAA does not currently regulate orbiting launch vehicle upper stage disposal strategies, including defining long-term disposal orbits, and limiting human casualty expectation to less than one in ten thousand.
I think the orbit qualifies as "long-term disposal orbit" nonetheless.
There is no binding international agreement. The UN has published Space Debris Mitigation Guidelines of the Committee on the Peaceful Uses of Outer Space. Several nations and groups have decided to follow these (NASA, ESA at least). These mostly focus on Earth orbit (where space debris is getting to be a problem). The guidelines contain various mitigation strategies, e.g:
- upper stages must be passivated to reduce the risk of an explosion
- LEO satellites must reenter after a certain amount of time