import bpy


class HelloWorldPanel(bpy.types.Panel):
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "object"

    def draw(self, context):
        layout = self.layout

        ### This seems to align correctly
        
        col = layout.column(align=True)

        col.box()
        col.prop(context.object, 'location', text='')


        ### This does not align correctly

        col = layout.column(align=True)
        
        col.prop(context.object, 'location', text='')
        col.box()
        
        ### This also does not align correctly
        
        col = layout.column(align=True)

        box = col.box()
        box.label(text='My Box')
        col.prop(context.object, 'location', text='')
        
        


def register():
    bpy.utils.register_class(HelloWorldPanel)


def unregister():
    bpy.utils.unregister_class(HelloWorldPanel)


if __name__ == "__main__":
    register()
