do monkeys imitate humans sometimes just for fun? Is it possible that sometimes when monkeys stand up on their two legs they are just imitating humans in order to communicate or have fun?
I can break this down into three questions.

(1) Do monkeys imitate? Do they ever imitate humans?

The answer to these questions is yes, though I don't know if that includes standing on two legs. 

(2) Do they do it to communicate?

Well, it is difficult to define what communication and with whom we are interested in here, but monkeys (and humans) do seem to be able to recognise when they are are being imitated. So at least the potential for communication is there.

(3) Do they do it to have fun?

There is plenty of evidence that monkeys "play", and depending on one's definition we can infer that they are having fun. Some play involves imitation.

For example this study by Byrne (2005) is an interesting source for some of the above answers, and in particular the "social mirroring" type of imitation implies some communication and theory of mind. We should also be careful here to distinguish between monkeys and apes, some of these behaviours are disputed in different species.