If you draw the tile regularly on the roof, that will not happen. It looks like you tried to shift click it from a tile already on the grass hence why the grass is there too.
What's happening is when you shift click, it copies the previous tile over *exactly* as it is in the old location. So if you place a fence on the grass, then shift click on it, you will map fences on grass. If you want fences on roofs, you have to map it on a roof first, then shift click it to the new location.
Or, to put it this way, you need to map the roof first, then put the fence on the roof, then shift click those fences to your desired location. Most people use a spare spot on the map for the drawing of the roof and fence that they are going to shift click from, which means if you don't have one you'll need to make a short term spare spot for it (this may mean deleting something, or making the map wider than it should be for a while).
Where did you get the wood floor tile from? I believe it needs to be in the A5 tile slot to work properly. If it is in the B-E tilesets, it will be erased when you put the fencing on top.
But where did you place it to be able to use it in an exterior set?
Okay, I somehow missed your second post with the carpet (which, by the way, please don't double post, just edit your last post) - I think because I was testing it out when you posted.
The reason the carpet works is because it is in an A tilesheet. If the flooring is in the A tilesheets, the fence will work. If the flooring is in any B-E it won't work, the A tile will overwrite it.
Also, I might be reading what you wrote incorrectly, but you can't simply assign an A tilesheet to a B-E space. They are not formatted correctly.