I guess probably that's because you are using wx.StaticBoxSizer. If I replace it with wx.BoxSizer, the border parameter works as expected. Here's a minimal example. I don't know the exact layout that you want. So, it may not do what you actually want but I hope it helps as a starting point.
(edit: code modified according to comment)
import wx
class myframe(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, title='Test', size=(200,200))
self.aPanel = wx.Panel(self, style = wx.RAISED_BORDER )
self.aLabel = wx.StaticText( self.aPanel, -1, 'Bar' )
self.aBox = wx.StaticBox(self.aPanel, -1, 'Foo')
self.aSizer = wx.BoxSizer( wx.HORIZONTAL )
self.aSizer.Add( self.aLabel, 0, wx.ALIGN_CENTER | wx.ALL )
self.aBoxSizer = wx.StaticBoxSizer( self.aBox, wx.VERTICAL )
self.aBoxSizer.Add( self.aSizer, 0, wx.ALIGN_LEFT | wx.ALL )
vbox = wx.BoxSizer(wx.VERTICAL)
vbox.Add(self.aBoxSizer, 1, wx.EXPAND | wx.ALL, 20)
self.aPanel.SetSizer( vbox )
self.Show()
if __name__ == '__main__':
app = wx.PySimpleApp(0)
frame = myframe()
app.MainLoop()