I'm not sure how you are connecting the RPi4 to the to the smartcard reader...
through a SP3232 module whose RS232 side connects to the X2 port (and FTDI port left open)?
If so then...
1) the SP3233 reads 3.3v at pin 16 when i connect the 9v battery.
Shouldnt it be zero? And then 3.3v when i connect the rpi 3.3v rail?
Im pretty sure the rpi 3.3v rail goes connected to this pin.
The sparkfun schematic says: 3.3v > VCC > 5v for the sp3232 module.
The tx/rx pins read 3.3v. Good. I think this is correct.
X2 connector only has signal wires (RX,TX,RTS) and GND; ie. power from the smartcard reader board isn't being offered to the module (like via a Vcc pin, naturally because this is a classic DTE wired RS232 port). Therefore, the sp3232 module is expected to get power from the host it's connected to. If the module is un-powered, sometimes chips get phantom power through one of the signal pins because there are protection diodes on these pins (that power is backfed from). Though, I'd expect these interface chips to be robust given many times there are RS232 signals present when the equipment it's connected to is off.
If the [unconnected] TX/RX pins (TTL/CMOS side) read 3.3V it could be because they have an internal pullup to Vcc or, if connected to the RPi4b, because the idle state of UART signals default to high (when not transmitting).
2) the 9v battery’s negative side is supposed to be on ground for the
reader. Can someone help me understand ground loops. Do i connect the
Sp3232 ground pin15 to the rest of the grounds from the smart card schematic?
What about the Rpi ground rail, when i finally finish,
do i use a jumper and connect the rpi GND to these grounds?
Yes, the SP3232 module GND and the reader GND should be connected via X2 GND pin.
Then the SP3232 module GND and RPi4b GND should also be connected too.
RPi4 J8 header pin 8 (GPIO 15, TxD) should be connected to the TTL/CMOS side of the SP3232 module IC (*either pin 10 or 11).
RPi4 J8 header pin 10 (GPIO 16, RxD) should be connected to the TTL/CMOS side of the SP3232 module IC (*either pin 9 or 12).
You will need another pin** (under app software control) on the RPi4 to source the RTS signal that toggles the RST (reset?) pin on the smartcard.
*I don't know which since you didn't provide the SP3232 module schematic JP2 to RPi4b pin mapping.
**It could be any other pin in the RPi4 header; look for a configuration parameter or application docs.
FYI: the smartcard board cheaps-out on the RS232 signal side by just sending TTL-level signalling (5V/0V) hoping the SP3232 will correctly interpret it (which technically is +/-3V to +/-15V; anything between +3 to -3 is illegal). The receive side just clamps any high voltages to 5.1V, low voltages to -0.7V via zener diodes (which is okay).