Is it necessary for a journal submission to include the names of the authors' departments? I would like to know if it is an unwritten rule to include the names of the departments of the authors' of a journal submission?
Strictly speaking, it is usually a written rule, as journals have written rules governing what they expect from submitting authors, and this usually includes information about their affiliation. It is an unwritten rule in the sense that tere is no rule that all journals should follow the same format, but it is very common to include the authors' affiliation. 

Sometimes this information is helpful as different departments belong to different "schools". So knowing the department alone can sometimes help you "place" the article in wider debates. Sometimes, it helps disentangle people with the same last name and the same initials. Regardless, this information only helps when you are an insider to the (sub-(sub-(sub-)))discipline discussed in the journal. However, those insiders are a legitimate audience for a journal, so I don't see a problem here.