I don't mean this to be snarky but this is like saying its stupid for a department store to hire in the lead-up to Christmas. They are going to have to lay many or most of them off after. Couldn't they see that Christmas wouldn't last forever?
Think of it this way - if there is a huge market/demand expansion, and you don't meet that need/demand, someone else will. Even if you think that much of that expansion is temporary, you will have fallen behind competitors in technology and market share. When the boom ends, they lay people off and you don't have to, but you are still behind now.