Standard Bell System (Western Electric, usually) terminal block. Appears to be missing the protective devices, but those are not needed since it's no longer the NID.
Sure, take it out and modernize if that makes you happier. Depending where the old wires run, it may not be at all easy to replace them, and there's no benefit to replacing them - what's there is standard and works fine for Plain Old Telephone Service - POTS or "analog lines" as they are known.
Here's an image of "what that used to do" when it was the NID/Demarc back in the day from a "Classic Rotary Phones" website. Note that in modern use it's just red and green unless you have two lines - the "yellow as ground" thing is very old - in the past multiple decades it would be another line on black and yellow, which would have run to another of those blocks "in that day."
If you really get bothered by the "messy" nature of it you can replace it with a newer terminal block while keeping the existing wires. But if voice quality on the lines is good as is, there's still no concrete benefit beyond "looks neater." Those were well made, and provide a very solid connection if wired properly.