You need to use facet_wrap() instead of facet_grid() or change the order of the faces in facet_grid() , as suggested in the comments.
The reason is that by definition facet_grid does not allow y-axis borders to be different in panels on the same line. In other words, all three panels in the top row must have the same y limits, all three panels in the second row must have the same y limits, etc. Adding scales = "free_y" means that the first row is allowed to have different y limits from the second row (but within this row all panels should always have the same y limits). In your example, when you use
facet_grid(facetA ~ facetB, scales = "free")
you force ggplot use all y values ββfor all lines; for example, the left pane in the top row should contain the value 2418|B , because this value is present in the middle pane of the top row. Facies order reversal occurs to do the job in this case due to the structure of your data. (I just give an example for the y axis, but the same is true for the limits of the x axis when using scales = "free_x" .)
If you want to have different x and y scales for each panel, regardless of those closest to it, you will need to use facet_wrap .
Edit A more detailed explanation of how to get the desired shape. Returning to your specific example, reversing your faces will give
p <- ggplot(data = data, mapping = aes(x=labelA, y=labelB)) + geom_tile(mapping = aes(fill=ol)) + scale_fill_gradient(low = "white", high = "black") + theme(legend.position = "none") + theme(axis.text.x = element_text(angle = 90, hjust = 1)) + facet_grid(facetB ~ facetA, scales = "free") p

This contains all the panels you want. To get the order you are requesting is just a matter of row swapping. This can be done by setting the order of facetB levels (edit: or, as @ user20650 suggested in the comments, setting as.table=FALSE in facet_grid() ):
data1 <- data data1$facetB <- factor(data1$facetB, levels = c("C", "B", "A")) p %+% data1
