Applying rotation, location and scale to model bones
You need the position for only loose bones. Instead of creating matrices assign the data where it belongs.

import bpy
if bpy.context.active_object.mode != 'POSE':
    bpy.ops.object.mode_set('POSE')

pbones = bpy.context.active_object.pose.bones

pbones['Spine'].location = m['position']
pbones['Spine'].scale = m['scale']

# I think your rotations are in quaternions, they are 4D
pbones['Spine'].rotation_quaternion = m['rotation']

# If not and you only use the first 3 values then:
#pbones['Spine'].rotation_mode = 'XYZ'
#pbones['Spine'].rotation_euler = m['rotation'][:3]


You can sure do this also by building the matrices, but check what your rotation data is in. You are building the rot_mat from Euler but I suspect your data being as quaternions.