How is it that Prince Philip the queen of england's husband is a prince and yet when william and Catherine got married the media said that Catherine would be queen if williams became king?

Because Prince Philip married a female member of the royal family, whereas Catherine married a male. The royal family often creates differences depending on which gender you are.