No, it doesn't mean "imitating something for the sake of it".
It means ritualistically imitating some advanced technology and thinking of it as magical way to get wealth and prosperity (based on primitive tribes building fake-airports and thinking that will bring the associated goods westerners coming to their land with airplanes had). And yes, it can involve all kinds of "rain dances or other backwards stuff" too.
"The name derives from the belief which began among Melanesians in the late 19th and early 20th century that various ritualistic acts such as the building of an airplane runway will result in the appearance of material wealth, particularly highly desirable Western goods (i.e., "cargo"), via Western airplanes."
No, "cargo cult" means imitating someone's activities that lead to a certain outcome, without understanding why did that work and why it might not work for someone else. In fact, to be precise, imitating the perceived activities: your coconut headphones might look like what that US army guy had on his head, but they don't have the whole technical and human infrastructure behind them; or, your Web search page might look exactly like Google's, but it won't produce similar results by itself.
It's more about misunderstanding cause and effect. Tribal people after WW2 started building runways on their islands because they thought that as long as they built the runways the airplanes would show up bringing their cargo.
They didn't imitate it "for the sake of it", they genuinely thought they would receive cargo by building runways.
So while it's not about rain dances and shakalaka sticks the previous commenter was on the money about the term cargo culting.