Because money and (stock) value is not strictly correlated. A business can lose money but their stock can be up because value depends largely on potential unrealised gain in the future. Then theres the fed making depositors whole again which means any negative sentiment against several banks before the feds involvement will recover. Maybe someone more knowledgeable could weigh in on that last part.