It could be a coping mechanism. You know babies cannot tell you about what they want, so crying is an effective communication tool. Crying before sleeping could also be soothing for baby. A friend of mine lets baby suckle on a pacifier before sleeping instead of drinking milk. It works and she doesn't have to waste milk as her baby is not really hungry, just needs help soothing himself to sleep.
http://www.livestrong.com/article/127483-babies-cry-before-sleeping/
Read more