:before and :after are inside the grid, that's why space-between gets applied on them thus the ambiguous spacing..
And as for the alignment in the last line, I don't think there's a solution for that if you're using space-between.. If the number of grid items are finite, you can maybe give :after some width to make the last line items look left aligned