This is because Theta is a STRUCT, not class. Structs are implicitly copied. When you are doing:
theta t = new theta();
layers[1][i].source[j] = t;
layers[0][j].destination[i] = t;
you end up with three copies of 't'. One original, one at index 1,i and one at index 0,j. Then, you assign 5 to only one of the copies. All others stay unmodified. This is how structs are different from class: they are assigned by value copying, not by-reference.