I agree with Pilot DAR, sounds like you did everything OK until you hit the brakes. You might have inadvertently put more pressure one brake and this is easily done if you are tense and in difficult flying conditions. When you realised you were weather cocking you may have then over compensated on the other brake and from here it can be easy to get into a braking induced PIO. If this happens just release pressure on both brakes and re-apply both smoothly and evenly.
The other possibility is aquaplaning. It can take as little as 1-2mm of surface water to allow aquaplaning to occur. If full aquaplaning occurs the tyres can actually spin down and come to a stop and that's without using the brakes! In full aquaplaning the surface water is fully supporting the weight of the tyre and can make directional control of the aircraft difficult to say the least. To work out the aquaplaning speed for your aircraft you can use the following formula; V=8.6√P (lbs/inē) or V=33√P (bar)
where V=full aquaplaning speed in knots and P=tyre pressure in units indicated.
When landing on a wet runway, make a firm touchdown and apply light continuous braking when the aircraft is firmly on the runway and the wheels have had time to spin up. Retardation on a wet runway will be considerably reduced therefore you will require more runway than normal. Use the entire runway if necessary. If you think the aircraft isn't slowing down rapidly enough and you are running out of runway, go around and have another go.