Is there some logic in issuance of yellow card to a player who takes his shirt off to celebrate a goal or is it just a rule?
Short answer, its just a rule: http://www.fifa.com/development/news/y=2004/m=6/news=clarification-law-yellow-card-for-removal-jersey-92958.html
Long answer, I personally think the player involved can be said to waste time and is delaying the restart of the game. Time wasting can be one of the logical reasons. One can also argue that the player is trying to taunt the opponents which is against the spirit of the game. Also its not common in any other sport.
This is actually a financial issue. When a player scores a goal the first thing that happens is the camera goes straight to him in close up. This gives everyone watching on TV a prolonged view of the shirt sponsor. If the player takes his shirt off the sponsor misses out on valuable exposure time. The yellow card is to make sure the sponsor gets as much exposure as possible making the shirt a valuable medium to spend your companies money on.
The rule of course then trickles down to the lowest levels of the game to ensure the game we watch on TV is as close as possible to the game we play at amateur level.
FIFA Law 12 for Unsporting Behavior - A player is cautioned if he removes his jersey over his head or covers his head with his jersey.
This law was already on the books but not really enforced until 2004 when FIFA decided to make it a mandatory yellow card. It is offensive in some countries to bare your chest and it is considered disrespectful. There is also a famous incident where Diego Forlan was unable to get his shirt back on before the kickoff. FIFA determined that it was unnecessary and unsporting. In addition, you can't wear masks or do anything else that covers your face.