What is this device and what is wrong with it?
It's the old sump pump, which was presumably working when the new sump pump was installed, and kept as a spare in case the new sump pump died. It looks about normal for an old sump pump (they sit in water and get cruddy.)

It's not actually "connected" to anything, though there may be a wire taped to the cut-off pipe.