Code is used in ways that other works are not. For example, code has source code, or "preferred form for modification", as the GPL calls it. Code, sadly, may run afoul of patents, whereas a novel or a painting probably does not. Software licenses usually have clauses around these points.
Contrariwise, some licenses like the GPLv3 have intentionally broad language to cover works other than code.
[1] https://creativecommons.org/software/