@Phantomlover1717 I fiddled around with the foundations a little bit, and I see what you mean, but they weren't raised at all. Also, it happens on just a few tiles and not the entire room or house. It does look like the edge of the foundation, so it may be a bug where it shows up in some places even when the foundation isn't raised.
I think the issue may be due to the fact that I'm making a sort of medieval house with no floor, only terrain paint. I tried putting on floor tiles and it seemed like the terrain was moving up and down ever so slightly as I moved the cursor with the floor tile around - indicating that the terrain isn't completely level, since I just built walls and no floor. So maybe the tiny difference in terrain height makes the game add a small foundation at the base of the wall where the ground is slightly lower.
EDIT: I just realised that lots are supposed to be completely level in the Sims 4, so I don't know if my theory is correct ...?