There is an annoying tendency among those of us in the Northern European tradition to demean the Spanish maritime tradition. Ditto the Portuguese and French. These guys were out there. I think it at least possible they knew there were islands there, perhaps visited them, but otherwise had little interest in them. On top of that, they probably didn't want anyone else setting up shop there, either.
Wasnt it the Spanish practice to treat geographical knowledge of the Pacific as a state secret, so as to maintain their competitive advantage against the other European maritime powers?
It sure was! However it was only the Spanish who had the trade network from the Far East to their ports in Mexico, and South America. Everyone else, particularly the Dutch, were more interested in going toward Europe.
I’ve personally never demeaned the Spanish or Portugese maritime adventures. They were true explorers. As much as the presence of the islands should lend itself to discovery, the distance involved suggests that the Spanish were not so lucky. Hawaii is about 2500 miles from Acupulco and maybe another 3,000 miles from Manilla. That’s a lot of food and water to carry. If they knew about Hawaii, it makes sense that they would establish a base there. It would allow the ships to carry less rations, which would allow them to carry more goods. The islands would be a shelter from storms in the South Pacific and a source of food and fresh water.