When you loop through setting the small rect, you set the top as boxMain.top + space
every time, and only increment the bottom. So really you are drawing 7 rectangles over the top of each other, but with increasing height each time.
Try something like the following:
int smallRectTop = 0
for(int i = 0; i <7; i++) {
Rect rect = new Rect();
rect.set(
boxMain.left + space,
smallRectTop + space,
boxMain.right - space,
smallRectTop += hMiniBox; // Increment and set rect.bottom at the same time
);
}