Wait, you were hired and laid off in the same week? I'm really sorry that happened to you. The fact that that was allowed to happen suggests a very dysfunctional and incompetent management culture.
I agree it's not a fun situation, but I'm curious what you expect to have happened instead. What would the "competent management" version of the situation look like?
In a competent management culture plans of impending downsizing would have been communicated to hiring managers and they would have adjusted their open reqs. It is not uncommon to be told during the interview process that a role has been frozen. It's personally happened to me on 3 occasions.