I'm no expert, but I believe it might be some sort of memory issue. I like to tab out (or in this case, switch tabs) to fix Youtube or whatever, and I think I found out what happened.
So, after placing your plants, I imagine that the plant takes up a tile, which disallows other plants from being placed there. However, if you were to switch tabs, the game seems to forget that those tiles are full, but the plants remain, allowing for Plant Stacks(tm).