The difference in the integrands is fundamentally important. The presence of $k$ makes a difference, apparently, in the way the integration algorithm arrives at an antiderivative.
(For instance, if the ratio of the exponents in Exp[k l] and Exp[l], i.e., k l / l = k, is rational, then the antiderivative can be expressed in terms of elementary functions; otherwise it seems not.)
A way that seems it might be convenient rests on recognizing the nature of the problem. Define a function to separate out the cases when k is a rational number or not:
myIntegral[k : _Integer | _Rational] :=
myIntegral[k] = Integrate[Exp[l]/((1 + Exp[l])*Exp[k*l]), l];
myIntegral[k_?NumericQ] :=
Integrate[Exp[l]/((1 + Exp[l])*Exp[k*l]), l];
Then, if you want, you can wrap both in a piecewise expression:
integral = Piecewise[{
{myIntegral[k], k \[Element] Rationals},
{Integrate[ Exp[l]/((1 + Exp[l])*Exp[k*l]), l], True}}]
integral /. k -> 2
(* -E^-l + Log[1 + E^-l] *)
There may be other ways of separating the cases that suit your intended use better.
Comment on the default antiderivative
I don't have access to v6, so just as a check, here is what I get (with or without Assuming[...):
int0 = Integrate[Exp[l]/((1 + Exp[l])*Exp[k*l]), l]
(* (E^((1 - k) l) Hypergeometric2F1[1, 1 - k, 2 - k, -E^l])/(1 - k) *)
This is valid antiderivative, but it does diverge as k -> 2.
You could use a definite integral to get something convergent:
intDef = Integrate[Exp[t]/((1 + Exp[t])*Exp[k*t]), {t, 0, l}]
(* ConditionalExpression[(-1)^k Beta[-1, 1 - k, 0] -
E^(-k l) (-E^l)^k Beta[-E^l, 1 - k, 0], E^l <= 0] *)
Unfortunately, it generates a condition that requires l to be imaginary. Sometimes these conditions are sufficient but unnecessary, a by-product of the algorithm, and the result is valid generically. That is the case here, which one can check. Alternatively, you can hope for the best -- it's a well-behaved integrand -- and ask for no conditions to be generated:
intNoCond = Integrate[Exp[t]/((1 + Exp[t])*Exp[k*t]), {t, 0, l},
GenerateConditions -> False]
(* (1/(2 (-1 + k)))E^(-k l) (-2 E^l Hypergeometric2F1[1, 1 - k, 2 - k, -E^l] +
E^(k l) (-1 + k) (PolyGamma[0, 1/2 - k/2] - PolyGamma[0, 1 - k/2])) *)
In either case, if you substitute k->2, the answer is Indeterminate:
{intDef, intNoCond} /. k -> 2
(* {ConditionalExpression[Indeterminate, E^l <= 0], Indeterminate} *)
And Limit will not yield up the answer, either. Oh dear. I would like to stress that the answers above all yield valid antiderivatives, although you cannot plug k=2 in directly. While they can be used, they won't suit your purposes.