I am not justifying the sinking, but I think what you write is misleading. Germany put an advertisement in the paper next to the ad for the Lusitania warning passengers that such ships might be sunk. The media had articles on the subject. Passengers were so worried the Captain of the ship had to reassure them by telling them the ship was too fast to be attacked by submarine. If that wasn’t enough, German spies were arrested on board early in the voyage.
(Note: One of my Great Grandparents traveled on the previous journey of the Lusitania too the U.S.)
Attacking passenger ships is a no-no for any navy, at any time.