The Wallace character wanted to get access to the daughter of Deckard as she can reproduce so he can build an army of replicants who can reproduce to colonised off world
The Wallace character wanted to torture Deckard because he knows that Deckard has information on the resistance who could lead them to his daughter
The replicants wanted k to kill Deckard to prevent Wallace from finding out the resistance
K decides to rescue Deckard and staged his death and not to kill him defying both Wallace and the revolutionaries.
I guess showing that K consider him his father even if he is not and just another replicant. I guess he is is father in a sense that his memory of his daughter freed him from his loyalty programming (by the way how exactly do these replicant are compelled to obey when we see both K and Luv disobeying).
The ending is unresolved because it is a sequel bait. We have Wallace still alive and the replicants near uprising but the knowledge of Rachel having a child still not publicly known