Add private bool firstT = true; and inside update add it to your if, also set the bool to false inside the condition ->
if(Input.GetKeyDown(KeyCode.T) && IsObjectXInvisible() && firstT)
{
SpawnObject();
firstT = false;
}
this ensures that SpawnObject(); happens only once.