Actually, Luther had nothing to do with the song:
"False attribution to Luther
The earliest known publication, in The Myrtle, ascribed the lyrics to German Protestant reformer Martin Luther, explicitly referencing his 400th birthday (which was in 1883). For many years this attribution continued to be made: for example Dainty songs for little lads and lasses for use in the kindergarten, school and home, by James R. Murray, (Cincinnati, The John Church Co., 1887) repeats The Myrtle's title of "Luther's Cradle Hymn" and the claim that it was "[c]omposed by Martin Luther for his children, and still sung by German mothers to their little ones". However, this attribution appears to be false: the hymn is found nowhere among Luther's works. It has been suggested that the words were written specifically for Luther's 400th anniversary and then credited to the reformer as a marketing gimmick."