CSR scipy matrix does not update after updating its values
Sparse matrix is a matrix that has most of its elements as zero. Matrix on the other side of it, is Dense. csr_matrix creates an all zero element matrix and if you are updating the elements as

m[i,j] = 0. 


Well, you're not really doing anything as elements are already zero. For example

import numpy as np
from scipy.sparse import csr_matrix
mat = csr_matrix((2,2), dtype = np.int16).toarray()
print mat,"\n"
for i in range(np.shape(mat)[0]):
    for j in range(np.shape(mat)[1]):
        mat[i,j] = i+j
print mat


gives

[[0 0]
 [0 0]]

[[0 1]
 [1 2]]


which is true, the first matrix,an all zero matrix created and the second, is the updated one.

Edit:

After substituting when $i==j$, the resultant matrix still has four elements but this time with $(0,0)$ and $(1,1)$ indices being $0$. So the result is 

(0, 0)    0
(0, 1)    1
(1, 0)    1
(1, 1)    0
(4,)


But explaining your expected result

(0, 1)    1
(1, 0)    1
(2,)


The result has basically two elements with $(0,1)$ and $(1,0)$ indices being $1$ and $1$ and shape is just $(2,)$ when flattened which does not make sense as matrix is still of size $(4,)$ . So python output is basically giving all the values in the matrix with index. If I am rightly understanding what you are assuming, since the matrix is sparse, you are expecting it to give only the values where the elements are non-zero, well this does not do that.

Hope it helps.