A surprisingly large number of students don't know what the equals sign means. Their understanding of the symbol "=" is essentially operational, not relational — they think it means "the next step" or "the answer" or is an instruction to perform some operation. Knuth et al. ("The importance of equals sign understanding in the middle grades", Mathematics Teaching in the Middle School, vol. 13, no. 9, May 2008) studied middle school students' understanding of the equals sign and identified this misunderstanding as both widespread and strongly correlated with inability to correctly solve basic algebra problems. This serious conceptual error often doesn't correct itself without being directly addressed; I've seen university calculus students make the same sort of mistakes.
Where does this error come from? As Knuth et al. remark:
Researchers have argued that the
operational view of the equal sign is
largely a by-product of students’ experiences with the symbol in elementary
school mathematics (e.g., Baroody
and Ginsburg 1983; Carpenter et
al. 2003; McNeil and Alibali 2005).
During elementary school, students
typically encounter the equal sign in
number sentences that have operations on the left side of the equal sign
and an answer blank on the right
side (e.g., 5 + 2 = __, 11 – 4 + 1 =
__). In solving such “operations equal
answer” equations correctly, it is not
really necessary for students to think
about the equal sign as a symbol of
equivalence; rather, students need only
perform the calculations on the left
side of the equal sign to get an answer.
As a result, students associate the
equal sign with the arithmetic operations performed to get a final answer.
There are even examples of exercises in elementary school mathematics textbooks that make the same error, using the equals sign in a way that can only be interpreted operationally. (I can't recall where I saw this; I'll add a link to an example if I find it. Edit: mweiss found this example, linked in the comments; that's not the same one I remember seeing, so there might be several textbooks doing this, or it could be from a different place in the same book.) Such textbooks have probably done quite a bit of damage.
Since conceptual understanding of equality is so essential to all mathematics beyond elementary arithmetic, I think it's advisable to have students solve problems that directly address the meaning of equality. I have no experience with teaching at that age, so I'll leave coming up with appropriate exercises and lessons to those who do. Instead, I'll just explicitly state the concept of equality that students must deeply internalize: "S = T" is the statement that S and T are literally the same thing, and consequently are indistinguishable in every way and interchangeable in every context. Syntactically, this amounts to the fact that any statement involving S is true if and only if the statement formed by replacing every instance of S with T is true.
As a side note, I suspect this is also related to an overly procedural concept of what other mathematical symbols mean; I'd guess many students who don't know what the equals sign means also interpret "1 + 2" as an instruction ("add these numbers"), not as a number. Thus, "1 + 2 = 3" is being interpreted as "if you perform the addition procedure on 1 + 2, you get 3", not as "the number 1 + 2 is the same thing as the number 3".