I'm pretty sure this is an installation gone bad. The white plastic rim visible just inside the wall covering looks like a compression fitting nut. I can see a couple of the ridges on the outside to make it easy to turn. It looks like there is the edge of a tan compression gasket peeking out at the inside edge of the nut.
The way it is supposed to work is that a pipe end (like your metal one, but removing the black gasket) is inserted into the white pipe opening, first loosening the white compression nut a bit. Once the pipe end is at the desired insertion depth, the white compression nut is tightened so it squeezes the tan compression gasket, forcing it to press all around the metal pipe section and form a water-tight seal.
You may be able to fix this setup pretty easily:
Remove all the brown/gray (sealing?) goop that is blocking the outside of the white compression nut from being turned.
Unscrew white compression nut a few turns to uncompress the tan gasket inside.
Remove black (extra) compression gasket from metal pipe and clean off all the goop visible on pipe's outside to leave a smooth surface.
Push metal pipe end through white compression nut/gasket to desired depth. As Mazura noted, it's usually easier to take out the compression gasket and slide it on to the pipe end (with white compression nut already slid on upstream) first before inserting the pipe end into the drain pipe. In this case, though, it looks like it might be hard to get the nut and gasket out of the wall; you'll have to judge yourself.
(This is the tricky part) Using something like two pairs of needle-nosed pliers, slide them in between the wall covering and the metal pipe to catch the bumps on the outside of the white compression nut and tighten it clockwise to again compress the tan gasket, sealing it against the outside of the metal pipe.
Slide shiny escutcheon ring over pipe to wall to again hide unsightly hole!
Note: tan compression gasket inside nut may be old and inflexible. If the drain still leaks there even after tightening the white compression nut "enough", you may have to fully unscrew and remove the nut (don't drop it down into the wall!) and buy a new replacement compression gasket of the same size and shape.