I think you might be misunderstanding what the decomposition should be doing. 'cause it looks correct to me... Let's go through your example's results, with some extra details and comments:
import numpy as np
import scipy.linalg
B = np.array([[2,-1,-2],[-4,6,3],[-4,-2,8]])
P,L,U = scipy.linalg.lu(B)
# Now let's see if P is a permutation matrix (a single 1 in each row and column, all the rest should be zero):
print(P)
>> [[ 0. 0. 1.]
[ 1. 0. 0.]
[ 0. 1. 0.]]
# Yup! That's a successful permutation matrix
# Now let's see if L is a lower triangular matrix (anything above the main diagonal should be zero):
print(L)
>> [[ 1. 0. 0. ]
[ 1. 1. 0. ]
[-0.5 -0.25 1. ]]
# Yup! still doing good.
# Now let's see if U is a upper triangular matrix (anything below the main diagonal should be zero):
print(U)
>> [[-4. 6. 3. ]
[ 0. -8. 5. ]
[ 0. 0. 0.75]]
# And last but not least, let's see if this works as a decomposition of B (i.e. PLU==B):
print(np.matmul(P, np.matmul(L, U)))
>> [[ 2. -1. -2.]
[-4. 6. 3.]
[-4. -2. 8.]]
# :-)
I hope that clarifies things a bit. If you're still not sure, then maybe reread about permutation matrices, triangular matrices, lu-decomposition, scipy.linalg.lu, and closely related topics.
Good luck!
It seems a clarification is in place:
LU-decomposition is not - in the general case - necessarily unique.
If you want details then aside for the relevant sub-chapter in the above wikipedia link, I recommend the first and third answers on this stack-exchange question.
So if you happen to get two different answers from to different implementations or methods, that doesn't mean that one or the other is wrong. If you've got a permutation matrix P (even if it's the trivial identity matrix), a lower-matrix L, an upper-matrix U, and they decompose your matrix, then you've got yourself a decomposition. Hope that clears things up!