My understanding, which is not intended to exclude other/different perspectives and answers, is this:
Two women were named "Tamar". The historical narratives simply records this fact. If we were intended to draw parallels between the Tamars, the narrative would have emphasized other similarities between them, or at least used similar wording. But apart from the fact that they were both part of sexual immorality (whose nature was, by the way, very different in the two different stories), no such similarities are apparent to me. Neither do I see reason to assume that one was named after the other - "Tamar" may simply have been a common name at the time. This is not to exclude the possibility of one being named after the other - certainly many Jews were named after Hannah or David. But Tamar, the gentile whose two husbands died before she prostituted herself to her father-in-law, would probably not be a person to name a kid after.
Thus: The same way I would not look for theological parallels between Niel Armstrong, Niel Diamond, and Niel Patrick Harris, neither would I look for parallels between Tamar daughter of David, Tamar the location (Ez 47:19), and Tamar the wife of Er.