They don't log IP addresses, but some governments have laws where the court can compel them to start logging, which is what they did here. It was also a unique situation between France and Switzerland where the two countries have specific agreements when laws between them are the same, such that if you commit a crime in one country the other will help to catch you. With ProtonMail being based in Switzerland, where the court order was issued, there was far less room for them to do anything about it.
What they did was in line with what their terms and conditions stated at the time. Afterwards, they reworded the terms to make it more clear.
All businesses have to comply with court orders, and unfortunately a single user isn't a hill worth dying on. All users and fundamentally undermining encryption is, though.