Twilight Imperium’s ‘Spend resources’ Objectives
You must spend these resources specifically to score the objective.  You have to make a choice between spending the resources on units/buildings and getting points to win.

These objectives are status phase objectives, meaning they can only be scored in the status phase.  Thus spending resources to build ships wouldn't apply because it happens during the action phase.  Furthermore, at the step in the status phase when you can score objectives, objectives are the only thing you can spend resources on.

Support from the rules reference:


  52.3 Each objective card indicates the phase during which a player
  can score that objective—either the status phase or action phase.
  
  52.10 Players can score some objectives by spending resources,
  influence, or tokens, as described by the objective card. To
  score such an objective, a player must pay the specified cost at
  the time indicated on the card.
  
  70.1 [STATUS PHASE] STEP 1—SCORE OBJECTIVES: Following initiative order,
  each player may score up to one public objective and one secret
  objective that can be fulfilled during the status phase. To score
  an objective, he must fulfill the requirements on the card; if he
  does, he gains a number of victory points indicated on the card.